Home Forums SQL Server 2005 Administering How To Get Last Inserted Record Value In SQL Server RE: How To Get Last Inserted Record Value In SQL Server

  • Just to make sure we completely cover the topic:

    An IDENTITY column will help you find the most recently-inserted row, unless IDENTITY_INSERT or DBCC CHECKIDENT (RESEED) are used to insert records out of order.

    A TIMESTAMP column will allow you to find the row used in the most recent INSERT or UPDATE.

    A DATETIME column with DEFAULT GETDATE() will work for single-row inserts, but if multiple rows are inserted in the same statement they will all have the same value.