Retrieve the last inserted identity of record safely, compare identity functions with a trigger, and capture multi-row values using OUTPUT.
SQL SERVER – Finding Out Identity Column Without Using Column Name
Did you know SELECT $identity finds the identity column without using column name? Here is how it works, and how to check if a table has one.
The Last Entered Row: Why a Table Needs an Ordering Column
A table has no last row until you define one. Here is how identity, event time and ties give different answers.
SQL SERVER – Add Auto Incremental Identity Column to Table After Creating Table
Can you add an auto incremental identity column to a table after it is created? The answer is both no and yes, and I show the ALTER TABLE script.
SQL SERVER – Reset the Identity SEED After ROLLBACK or ERROR
A reader noticed that a failed insert still bumps the identity value. I show how to reset the identity seed after a ROLLBACK or an error.
SQL SERVER – Query to Find Seed Values, Increment Values and Current Identity Column Value of the Table with Max Value of Datatype – Part 2
Harsh improved the identity query from Part 1 so it also works when seed values or increment values are not 1. Here is his script.
SQL SERVER – Query to Find Seed Values, Increment Values and Current Identity Column Value of the Table with Max Value of Datatype
Mark Hickin improved my old query, so it now shows seed, increment and current identity column value along with the max value of the datatype.





