SQL Server 2005 introduces the OUTPUT clause, a bit of magic that allows us to get the identity value, plus a number of other values, from an INSERT, UPDATE, or DELETE, which all have different interaction with OUTPUT. This article concentrates on INSERT.
Read more...