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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Full-Text Search
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

6 Posts

Posted - 11/18/2012 :  07:05:18  Show Profile  Reply with Quote

I am quering a big table (about 150,000 rows) with a big varchar field (size 2000) which can't be indexed (and there's no point even if it could be). I am using Sql Server 2008.
The query I used till now was:

select *
from tbl_name
where field_name like '%bla bla%'

("bla bla" is according to what the user searched for)

In order to improve performence, I wann'a start using the Full-Text Search feature (already defined a catalog and a text index on this field).
I am a bit confused from what I read about quering with this option.
what query should I use in order to get exactly the same results as the query I used to use before?

* Comments:
1. I would like to get results which are not case sensative, as it worked before (meaning if the user searches for "LG" he will also get results that contains "Lg").
2. If user enters "Sams" he will also get "Samsung".


Edited by - Eran on 11/18/2012 12:34:30

Starting Member

6 Posts

Posted - 11/19/2012 :  04:21:58  Show Profile  Reply with Quote
I want to query by the whole string that the user has entered, as one phrase.

The CONTAINS query doesn't returns the results I need even with one word.

Lets say I have 5 rows in the DB:

1. ggg Eran fff
2. hhhEranttt
3. Eranggg
4. hhhhh Eran
5. rrrggg Eran fffhhh

and I query by:

FROM tbl_name
WHERE CONTAINS(field_name, '"eran"');

I only get rows 1,4,5 as the results, but I need to get them all.

So, there is no way to use the free text index instead of quering by

WHERE field_name LIKE '%[search_text]%' ?

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000