These are the various choices you have to get the latest identity entered into a table in SQL server
SELECT @@IDENTITY
SELECT SCOPE_IDENTITY()
SELECT IDENT_CURRENT(‘tablename’)
The most often I personally use is SELECT SCOPE_IDENTITY()
The most often I personally use is SELECT SCOPE_IDENTITY()
I will defer to an excellent article from Pinal Dave for an explanation on each of these
No comments:
Post a Comment
Comments will appear once they have been approved by the moderator