header image
 

SQL SERVER – @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT

Long story short – use SCOPE_IDENTITY() when you need the ID generated in the primary key block to be used in the Foreign Key table insert.

SQL SERVER – @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT – Retrieve Last Inserted Identity of Record « Journey to SQL Authority with Pinal Dave

SQL SERVER – @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT

~ by shoel on April 7, 2010 .



Leave a Reply