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 |
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2004-02-18 : 20:02:47
|
| I've done this before, but its been awhile.. hopefully somebody can give me a refresher on this one. I have created a table which has the same table structure as another table. I want to insert all the rows that I select from the source table, into the new empty table. There's about 30 columns.Whats the best way to do this?Thanks alotmike123 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2004-02-18 : 20:20:44
|
| Hi MikeINSERT INTO Table2 (col1, col2, col3 etc)SELECT col1, col2, col3 etcFROM Table1You have to specify all the columns, but a nice shortcut to stuff like this is "Exec sp_help Table1" in query analyzer will return them all for you.Damian |
 |
|
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2004-02-18 : 22:25:55
|
thanks again damian !  |
 |
|
|
|
|
|