Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

best way to search a database?

Status
Not open for further replies.

zippynz

Programmer
May 17, 2001
50
0
0
NZ
Hi,

I'm just wondering what is the best way to search a database?
I have allways used Access for my web projects and have just started using SQL 2000. I hear there is a way to search using index server? anyone done this before? what are your thoughts, comments advice etc.. ?

Thanks :)
 
well i have a table with a whole lot of numeric fields which need to be searched through and also stings of text.
Using the LIKE operator is how I would do it, but apparently it is not that efficent
 
You could create indexes over the fields you want to search and avoid for varchar fields this conditional: fieldX like '%word%' because your index wouldn't be used. It would be faster fieldX like 'word%' (Because the index is used). For integer fields the condictional FieldA between X and Y is fast.
You can check the query execution plan to see if the indexes are being used.
 
SQL Server 2000 has an option when you install it for free-text searches. Haven't used it, so I don't know how well it handles things like foreign languages, but it might be worth looking up on MSDN.

Chip H.
 
umm how do you create an index on the fields?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top