diff --git a/PROMS/DataLoader/PROMSFixes.Sql b/PROMS/DataLoader/PROMSFixes.Sql index 5520bcc2..7344f088 100644 --- a/PROMS/DataLoader/PROMSFixes.Sql +++ b/PROMS/DataLoader/PROMSFixes.Sql @@ -3033,11 +3033,18 @@ IF isnull(@SearchString,'%')='%' ELSE BEGIN Declare @SearchStringx nvarchar(200) --kbr - set @SearchStringx = replace(@SearchString,'-','\u8209?') --kbr + --set @SearchStringx = replace(@SearchString,'-','\u8209?') --kbr --set @SearchStringx = replace(replace(@SearchString,'-','\u8209?'),'\','\u9586?') --kbr + set @SearchStringx = replace(@SearchString,'\u8209?','-') --JSJ B2016-209 not finding dashes in Word sections (FixSearchString converts '-' to '\u8209?') IF @CaseSensitive = 0 -- Not Case Sensitive BEGIN insert into @FoundContents + select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchString,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) C + where + (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchString Collate SQL_Latin1_General_CP1_CI_AS) + AND ((isnull(@StepTypeList,'') = '' /*and dbo.vefn_AllSections(C.Type)>=10000*/) + or ((dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))))) + UNION -- B2016-209 to find dashes in word sections select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchStringx,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) C where (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchStringx Collate SQL_Latin1_General_CP1_CI_AS) @@ -3048,7 +3055,7 @@ ELSE join Entries E on C.ContentID = E.ContentID join Documents D on E.DocID = D.DocID where - (D.DocAscii like @SearchString Collate SQL_Latin1_General_CP1_CI_AS) + (D.DocAscii like @SearchString OR D.DocAscii like @SearchStringx Collate SQL_Latin1_General_CP1_CI_AS) AND ((isnull(@StepTypeList,'') = '' /*and dbo.vefn_AllSections(C.Type)>=10000*/) or ((dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))))) @@ -3058,17 +3065,24 @@ ELSE IF @CaseSensitive = 1 -- Case Sensitive BEGIN insert into @FoundContents + select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchString,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) C + where + (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchString Collate SQL_Latin1_General_CP1_CS_AS) + AND ((isnull(@StepTypeList,'') = '' /*and dbo.vefn_AllSections(C.Type)>=10000*/) + or ((dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))))) + UNION select C.ContentID from vefn_FindContentText(@DocVersionList,@SearchStringx,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) C where (.dbo.vefn_RemoveExtraText(C.Text,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) like @SearchStringx Collate SQL_Latin1_General_CP1_CS_AS) AND ((isnull(@StepTypeList,'') = '' /*and dbo.vefn_AllSections(C.Type)>=10000*/) or ((dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))))) - UNION + + UNION -- B2016-209 to find dashes in word sections select C.ContentID from (select * from Contents where ContentID in(select ContentID from vefn_DVContent(@DocVersionList))) C join Entries E on C.ContentID = E.ContentID join Documents D on E.DocID = D.DocID where - (D.DocAscii like @SearchString Collate SQL_Latin1_General_CP1_CS_AS) + (D.DocAscii like @SearchString OR D.DocAscii like @SearchStringx Collate SQL_Latin1_General_CP1_CS_AS) AND ((isnull(@StepTypeList,'') = '' /*and dbo.vefn_AllSections(C.Type)>=10000*/) or ((dbo.vefn_AllSections(C.Type) in (Select ID from vefn_SplitInt(@StepTypeList,','))))) @@ -13127,8 +13141,8 @@ BEGIN TRY -- Try Block set nocount on DECLARE @RevDate varchar(255) DECLARE @RevDescription varchar(255) - set @RevDate = '8/22/2016 8:30 AM' - set @RevDescription = 'Updated ve_GetItemDerivedApplicability for Non PC P/C Procedure Sets (Maximum Applicability)' + set @RevDate = '9/16/2016 1:30 PM' + set @RevDescription = 'Fixed Search for dash character in Word sections' Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription IF( @@TRANCOUNT > 0 ) COMMIT