Category Archives: SQL

Output inserted values instead of scope_identity()

In the faint hope that I’ll remember this instead of doing it the hard way… When inserting rows into a table that has calculated rows (in particular an identity column), it is possible for SQL Server to output a selection of the inserted values into a table variable. This is useful if the value of