declare @ChangeTracking table ( Idn int, OldTitle nvarchar(max), NewTitle nvarchar(max) )

update DemoIdentity
set Title = Title + ' updated'
output inserted.idn, deleted.Title, inserted.Title into @ChangeTracking

select * from @ChangeTracking
-- Notice the deleted table contains the rows before being updated
-- and the inserted table contains the rows after being updated.
Advertisements