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 |
|
Marioi
Posting Yak Master
132 Posts |
Posted - 2007-05-15 : 11:51:04
|
| I am looking for a way to select or COUNT(*) rows in which any of the fields contain a string. Something like:SELECT *FROM tWHERE * LIKE '%string%'I can compose a dynamic statement in .net with tens of WHERE conditions with ORs, but is there a native TSQL way? I would restrict my dynamic statement to (n)char, (n)varchar and (n)text fields.What is the best way to search through all tables? Loop through a cursor of tables returned by sysobjects? TIA. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-15 : 11:55:46
|
| See this: [url]http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm[/url]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Marioi
Posting Yak Master
132 Posts |
Posted - 2007-05-15 : 14:43:23
|
| Thank you, a nice sproc - saved me time! |
 |
|
|
|
|
|