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 - 2002-03-13 : 08:49:38
|
| Samir writes "I checked you articles formultiple tables,multiple tables union,string tables union,string multiple tables unionand found no answer, so here goes...How can I write a union query loop that unions 10 tables (same fields) without having to write 9 UNION SELECT statements. Essentially I don't want to hard code. Use as simple SQL as possible without using T-SQL specialities." |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-13 : 08:57:14
|
| Why don't you want to hard code it? Are you choosing 10 tables at random? You want "as simple SQL as possible" but "I don't want to hard code". These 2 statements contradict each other.Can you tell us more about what you're trying to do?Edited by - robvolk on 03/13/2002 08:57:36 |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-03-13 : 13:23:56
|
| why not use some form of Dynamic SQL with the table names passed in using variables? |
 |
|
|
|
|
|