Quantcast
Viewing latest article 2
Browse Latest Browse All 13

Sql Identity Retrieval - Alternative Methods

Has anyone ever had an issue returning a value for @@Identity? If so, here is one work around that you can try.

Basic Insert Statement:

-- Run Me
INSERT INTO dbo.tbl_X (Storename)  VALUES( 'test qae3')

-- Use this instead of @@Identity. 
select SCOPE_IDENTITY()
select IDENT_CURRENT('dbo.tbl_X') AS NewID


Viewing latest article 2
Browse Latest Browse All 13

Trending Articles