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 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2004-12-01 : 14:19:02
|
| Is there a way to easily copy all fields (except identity) from one table to another in a stored procedure and then delete the row from the first table after it's inserted in the second.Basically I have data in a temp table.After I do all validation I will want to move it to the regular table (same structure) and delete from temp. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-12-01 : 14:29:41
|
| INSERT INTO Table1...SELECT...FROM #TempWHERE...DELETE FROM #Temp WHERE..Tara |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-12-01 : 14:58:29
|
| They're looking forINSERT INTO myTable99(All Cloumns Except Col1)SELECT All Columns Except Col1Doesn't existsBUT You could SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = 'myTable99'So you don't have to type them all outBrett8-) |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-12-01 : 15:00:16
|
| Ah, lazy programming.Tara |
 |
|
|
|
|
|