I believe you want this:
select * from files where contains(file_stream,'"SQL Server"')
notice the double quote.
Вопрос
Search for a whole sentence in a file stored in file table using CONTAINS
command ?
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.