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 |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2008-04-18 : 08:00:26
|
| I want to copy a record from one table to another using an sp. The idea is like this but I need help with the syntax. The fields are identical in each tableInsert into myTable (Select * from Anothertable where RecId = @MyParamcan anyone help with this please ? |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-04-18 : 08:07:15
|
| Insert myTable Select * from Anothertable where RecId = @MyParamIt's better to name the columns thoughInsert myTable (col1, col2, ...)Select col1, col2, ...from Anothertable where RecId = @MyParam==========================================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. |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2008-04-18 : 09:39:41
|
| Thanks for your help. The trouble is that I have about 80 columns which is why I didn't want to name them all :-) |
 |
|
|
|
|
|