Fixed logic to find dashes

This commit is contained in:
Rich 2013-03-13 21:47:27 +00:00
parent 33fc77ca02
commit 23b9f54614

View File

@ -2975,7 +2975,7 @@ ELSE
END END
RETURN RETURN
END END
GO GO
-- Display the status of Proc creation -- Display the status of Proc creation
IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_FindText Succeeded' IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_FindText Succeeded'
@ -6393,3 +6393,49 @@ GO
IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_JustSiblingItems Succeeded' IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_JustSiblingItems Succeeded'
ELSE PRINT 'TableFunction Creation: vefn_JustSiblingItems Error on Creation' ELSE PRINT 'TableFunction Creation: vefn_JustSiblingItems Error on Creation'
GO 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