Вопрос

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