Export (0) Print
Expand All
Expand Minimize

Returns the last-inserted identity value.



SELECT @@IDENTITY AS TEMPNAME
or
SELECT @@IDENTITY AS [TEMPNAME]
or
SELECT @@IDENTITY AS "TEMPNAME"


numeric


If you create a table in SQL Server Compact 3.5 that uses an identity column and then run a query in which an INSERT fails, the value of @@IDENTITY will still increment.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft