Search for a whole sentence in a file stored in file table using CONTAINScommand ?

For example if user enter "SQL Server" sentence I want to search for files that just contain exactly "SQL Server" not "SQL SOME TEXT Server"

I get the following error : Syntax error near 'Server' in the full-text search condition 'SQL Server'

select * 
from files 
where contains(file_stream,'SQL Server')

Then I try this one :

select * 
from files 
where contains(file_stream,'SQL AND Server')

But this returned files containing "SQL SOME TEXT Server" too.

How do I correct this?

有帮助吗?

解决方案

I believe you want this:

select * from files where contains(file_stream,'"SQL Server"')

notice the double quote.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top