How do I do this in TSQL? : How UPDATE and SELECT at the same time
Asked
Active
Viewed 85 times
2 Answers
4
The TSQL equivalent of the answer in the linked question would be something like
UPDATE [table]
SET foo=1
OUTPUT INSERTED.*, DELETED.*
WHERE boo=2
In an update statement you can use INSERTED to get the "after" values and DELETED the "before" values.
Martin Smith
- 419,657
- 83
- 708
- 800