Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 LIKE shows results, CONTAINS doesn't

Author  Topic 

jcyl29
Starting Member

2 Posts

Posted - 2010-04-15 : 18:51:37
Hello, I have a field called description with an entry like this:

quote:
Full-service capabilities in design, engineering and manufacturing, with an innovative ability to supply low-tech components with a high-tech inventory system,


I want to know why a query like:
select description from TBL where description LIKE '%with a%'

will return the entry i mentioned whereas a query like:
select description from TBL where CONTAINS(description, '"with a"')

won't return anything

Appreciate any input on this.
Thanks, Justin

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-15 : 19:28:13
Do you have a full-text index on that table?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-15 : 19:30:10
Also, did you try removing the double quotes?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jcyl29
Starting Member

2 Posts

Posted - 2010-04-16 : 00:50:55
yes, it has a full text index enabled, and when i remove the double quotes get a syntax error message.

Running the query on SQL management studio express
Go to Top of Page
   

- Advertisement -