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 2000 Forums
 Transact-SQL (2000)
 quick one

Author  Topic 

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-04-05 : 05:48:40
please help to retrieve a record by
checking if n-number of words are in a column value, the words are jumbled up and they should all appear in that column and set-based (i already have the query for record by record process)

example column value:
the quick brown fox jumps over

another value

the brown fox

search critiera : jumps, quick,the

so, only the first one will be retrieved. i tried contains, patindex, join to a table with the criteria words as column values...

any help will be appreciated...

--------------------
keeping it simple...

ijprasad
Starting Member

29 Posts

Posted - 2005-04-05 : 08:43:02
we can help you, if gives the detail problem description with sample data

Inderjeet
Go to Top of Page

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-04-05 : 09:00:42
Jen
Is this what you are after

[url]http://www.sqlteam.com/item.asp?ItemID=2652[/url]

Andy

Beauty is in the eyes of the beerholder
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-04-05 : 09:09:37
This might be helpful for you, it sounds like it might be exactly what you need:

http://weblogs.sqlteam.com/jeffs/archive/2004/11/02/2460.aspx

- Jeff
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-04-05 : 23:42:58
quote:
Originally posted by jsmith8858

This might be helpful for you, it sounds like it might be exactly what you need:

http://weblogs.sqlteam.com/jeffs/archive/2004/11/02/2460.aspx

- Jeff



wow Jeff this is exactly what i need. Thanks for the link, great! I'll study the logic

I'll try robvolk's approach too, Thanks Andy

--------------------
keeping it simple...
Go to Top of Page

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-04-06 : 02:43:23
Jen
I've just noticed from your original post that you tried CONTAINS, have you full-text indexed this table?
If so you could use FREETEXT

DECLARE @Search varchar(50)
SET @Search = 'jumps, quick, the'

SELECT *
FROM YourTable
WHERE FREETEXT(YourCol, @Search)


Andy

Beauty is in the eyes of the beerholder
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-04-06 : 05:24:27
yes, freetext looks promising, i'll try this too

thanks again Andy

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -