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
 General SQL Server Forums
 New to SQL Server Programming
 Search for String

Author  Topic 

lushgreenplanet
Starting Member

2 Posts

Posted - 2009-10-26 : 18:27:30
I have to search for a string in a database . The string is input by the user .

example : the user could enter " culturally diverse Americans " the query should look through a column and return all records which has the words " culturally diverse Americans " in any order. Also it should it retrieve all records which have other words with along these key words combination. for example even if a record has the string " European American studies cultural " it should be returned. Please help !

lushgreenplanet
Starting Member

2 Posts

Posted - 2009-10-26 : 19:00:56
basically like a google search
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-27 : 02:47:02
My guess is you need to split the string and then compare with the column

Where column like '%'+split_function(your_string)+'%'

Search for split function in this forum

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

saralstalin
Starting Member

11 Posts

Posted - 2009-10-27 : 07:41:41
Use Full text search feature in SQL server.

Saral S Stalin
Go to Top of Page
   

- Advertisement -