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 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2011-11-21 : 11:42:43
|
| how can I do a select union from a table into a temp table on the fly...The following sql does not work. Can you see what I am doing wrong please? Thanksi.e.select field1, field2 rom tbl1union Allselect field1, field2 from tbl2into#tblTempDataThanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-21 : 11:46:25
|
| [code]select *into #tblTempDatafrom(select field1, field2 from tbl1union Allselect field1, field2 from tbl2)t[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
DP978
Constraint Violating Yak Guru
269 Posts |
Posted - 2011-11-21 : 14:40:33
|
| AlsoSelect Field1, Field2 Into #tblTempDataFrom tbl1Union AllSelect Field1, Field2From tbl2 |
 |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2011-11-21 : 17:08:57
|
| Thank you |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-22 : 01:13:28
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|