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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-11-02 : 07:48:25
|
| Roland writes "I have a query that will find all tables that have a specific column name. After I find the column how can I find specific data for that column?Example:I can find the column Order_Number in table_1,Table_3,table_7.Now I want to see if a particular order is in 1 or all 3 of the tables.Thanks for your time." |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-11-02 : 07:55:46
|
| You will have to use dynamic sql if you don't want to code all the possibilities.exec ('select * from ' + @mytbl + ' where ' + @mycol + ' = ' + @myorder)==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|