@@IDENTITY (SQL Server Compact)

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.

See Also

Other Resources

@@IDENTITY (Transact-SQL)