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 |
|
pazzy11
Posting Yak Master
145 Posts |
Posted - 2010-04-19 : 10:24:16
|
Hi , Using the OUTPUT clause I have the following code DELETE FROM [Order Details]OUTPUT deleted.* INTO OrderDetailsArchiveFROM Orders join [Order Details]ON Orders.OrderID = [Order Details].OrderIDWHERE OrderDate < '12-01-1997'; This deletes all orders before 12-1-1997 and dumpsthem into an archive table - but of course you can see that ;)Anyway my question , with the OUTPUT deleted.* INTO OrderDetailsArchive the .* , this just means "all data" ? - in this case all data deleted ? |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2010-04-19 : 10:34:29
|
| yes -- all columns in the deleted set. (Imagine this is a trigger then the deleted table contains all the rows that were deleted).Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-19 : 10:34:45
|
It means all COLUMNS. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-19 : 10:35:36
|
This old rocker was too slow again. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
pazzy11
Posting Yak Master
145 Posts |
Posted - 2010-04-19 : 10:56:36
|
| Thanks !" |
 |
|
|
|
|
|