SQL Server 2000

The friendliest place on the web for anyone that follows U2.
If you have answers, please help by responding to the unanswered posts.

polka king

Babyface
Joined
Feb 28, 2001
Messages
17
This is not U2 related, but I'm in a bind, and I'm wondring if any of you folks might be able to help me.

Anybody here develop for SQL Server 2000? I'm currently doing some makeup work for my company, and I was wondering if someone could help me with a SQL Statement. I want to write a command to search a certain table for a keyword. I want to find all fields in all records from the B_Log table in which the Note field contains the word "test", so the statement I came up with is:

Select * from B_Log where Note like '%test%'

That works, but someone told me that if there are too many records, the way it's written now will slow down the query and that I should use a CONTAINS statement instead of like. However, I can't get any CONTAINS statements to work, and the guy who told me, his example doesn't even work. Any ideas?
 
Originally posted by polka king:
This is not U2 related, but I'm in a bind, and I'm wondring if any of you folks might be able to help me.

Anybody here develop for SQL Server 2000? I'm currently doing some makeup work for my company, and I was wondering if someone could help me with a SQL Statement. I want to write a command to search a certain table for a keyword. I want to find all fields in all records from the B_Log table in which the Note field contains the word "test", so the statement I came up with is:

Select * from B_Log where Note like '%test%'

That works, but someone told me that if there are too many records, the way it's written now will slow down the query and that I should use a CONTAINS statement instead of like. However, I can't get any CONTAINS statements to work, and the guy who told me, his example doesn't even work. Any ideas?

I only know a little bit about SQL but I'm pretty sure the CONTAINS predicate is used for when you want to search tables with full-text indexing set up on them.

So try setting your table up with full-text indexing and try again
 
Originally posted by Bonovation:
I only know a little bit about SQL but I'm pretty sure the CONTAINS predicate is used for when you want to search tables with full-text indexing set up on them.
So try setting your table up with full-text indexing and try again
Wow, great idea. I'll try it! Thanks! Do you charge a consulting fee?
 
Back
Top Bottom