Fixed logic to find dashes
This commit is contained in:
parent
33fc77ca02
commit
23b9f54614
@ -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
|
Loading…
x
Reference in New Issue
Block a user