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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2010-05-17 : 14:43:02
|
| I can insert * into temp table as below without create temp table first: SELECT * INTO #myorder FROM orderIs there a way do the same in table variable? (I tested but got an error) SELECT * INTO @myorder FROM order |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2010-05-17 : 14:59:03
|
| Nope, you have to DECALRE a table variable first. |
 |
|
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2010-05-17 : 15:10:08
|
| There are about 50 columns in order table.To declare table variable, does need to list all columns and data type one by one? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|