diff --git a/PROMS/DataLoader/PROMSFixes.Sql b/PROMS/DataLoader/PROMSFixes.Sql index 0c90f79e..96604b95 100644 --- a/PROMS/DataLoader/PROMSFixes.Sql +++ b/PROMS/DataLoader/PROMSFixes.Sql @@ -2975,7 +2975,7 @@ ELSE END RETURN END - + GO -- Display the status of Proc creation IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_FindText Succeeded' @@ -6393,3 +6393,49 @@ GO IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_JustSiblingItems Succeeded' ELSE PRINT 'TableFunction Creation: vefn_JustSiblingItems Error on Creation' GO + +/****** Object: StoredProcedure [vefn_FindContentText] ******/ +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_FindContentText]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1) + DROP FUNCTION [vefn_FindContentText]; +GO + +/* +SELECT * From vefn_FindContentText('1','%RCP%') +*/ +/***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2012 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ +CREATE FUNCTION [dbo].[vefn_FindContentText]( +@DocVersionList nvarchar(MAX) +,@SearchString varchar(MAX)) +RETURNS @FoundContents TABLE +( + ContentID int PRIMARY KEY + ,Type int + ,Text varchar(max) +) +WITH EXECUTE AS OWNER +AS +BEGIN +IF(ISNULL(@DocVersionList,'')='') + BEGIN + INSERT INTO @FoundContents -- Do a case insensitive search + select ContentID,Type,Text from contents + where Replace([Text],'-','\u8209?') like @SearchString Collate SQL_Latin1_General_CP1_CI_AS + END +ELSE + BEGIN + INSERT INTO @FoundContents -- Do a case insensitive search + select ContentID,Type,Text from contents + where [ContentID] in (select [ContentID] from vefn_DVContent(@DocVersionList)) + AND Replace([Text],'-','\u8209?') like @SearchString Collate SQL_Latin1_General_CP1_CI_AS + END + +RETURN +END +GO +-- Display the status of Proc creation +IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_FindContentText Succeeded' +ELSE PRINT 'TableFunction Creation: vefn_FindContentText Error on Creation' +GO \ No newline at end of file