Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the last-inserted identity value.
Syntax
SELECT @@IDENTITY AS TEMPNAME
or
SELECT @@IDENTITY AS [TEMPNAME]
or
SELECT @@IDENTITY AS "TEMPNAME"
Return Value
numeric
Remarks
If you create a table in SQL Server Compact that uses an identity column and then run a query in which an INSERT fails, the value of @@IDENTITY will still increment.