I am attempting to do a fulltext search on a table where one of the rows is a log and contains characters such as ,.: and so on. Currently when a query is ran using the 'Contains' keyword which includes any of those characters no rows are returned. Is there any advice on the best route that can be take for this search? Here is what my current query look like at the moment:
ALTER Procedure [dbo].[searchLog]
@searchValue varchar(150)
AS
Declare @myquote varchar(10)
Declare @wildcard varchar(5)
set @myquote ='"'
set @wildcard ='*'
set @searchValue = @myquote + @searchValue + @wildcard +@myquote
BEGIN
SET NOCOUNT ON
SELECT o.ID, o.Name, o.DateRan, s.Name AS Job, o.Start, o.[End], o.Status, o.Logs
FROM dbo.o AS o LEFT OUTER JOIN
dbo.j AS j ON o.Job = j.ID LEFT OUTER JOIN
dbo.s AS s ON j.Script = s.ID
WHERE CONTAINS ((o.Name, o.Logs), @searchValue)
ORDER BY o.ID DESC
Example of Logs being searched:
"Sunday, July 7, 2019 1:20:00 PM
Seeking c:\xxxx\xxxx\log1_date.txt
Seeking c:\xxxx\xxxx\log2_date.txt
Seeking c:\xxxx\xxxx\log4_date.txt
Monday, July 8, 2019 1:20:00 PM FTP AND PGP COMPLETED Processed 0 files ."