Note that post #4 contains links for downloading SQL Server Express and various other items, and links to more useful information.
Saw this yesterday - thought it was a really neat T-SQL trick...
Will return the 3 columns indicated after the OUTPUT keyword as a SELECT statement after the UPDATE is performed...Code:update sometable set somecol = 'ABC' OUTPUT inserted.keycol 'Key', deleted.somecol 'Old', inserted.somecol 'New' where keycol = 1
Note that the columns come from those "trigger" like tables - the INSERTED and DELETED tables...
I get excited easily
edit: it's only SQL 2005 that will support this
Here's what it looks like:
comes back with...Code:begin tran select * from lettertyp_t where lettertyp='AP' update lettertyp_t set lettertype='ABC' OUTPUT inserted.lettertyp 'Key',deleted.lettertype 'Old' ,inserted.lettertype 'New' where lettertyp='AP' rollback
Code:LetterTyp LetterType TDate --------- ------------------------------ ------------------------------------------------------ AP Acknowledgement of Paternity NULL (1 row(s) affected) Key Old New --------- ------------------------------ ------------------------------ AP Acknowledgement of Paternity ABC (1 row(s) affected)





