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.
| Author |
Topic |
|
Beuntje
Starting Member
1 Post |
Posted - 2006-02-17 : 09:02:54
|
| I'm searching for the fastest way to find records containing some word. My table "tblInfo" contains more than 40 columns: id, parentid, treelevel, field1, field2, field3, field4, ... field43, field44, field45and I want to make a search-QRY to find all records where any of the fields contains "findthis"Now I'm having the string "select * from tblInfo where field1 like '%findthis%' or field2 like '%findthis%' or field3 like '%findthis%' or ... or field45 like '%findthis%';"Is there any method to make this QRY shorter (and faster?)greatings, Benedikt Beun |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-02-17 : 09:36:31
|
| Two other options:1) Read up on Full Text indexing.2) You can normalize your tables, then will need to search fewer columns. |
 |
|
|
|
|
|