When you are trying to get the last Identity value in SQL Server, the old way was to use the @@IDENTITY variable.
This, however, can easily give you the wrong answer back. For example, if you have a trigger inserting a history record that also contains an identity column.
Here is an article that discusses why you should probably stick to SCOPE_IDENTITY().
Remember Me
Powered by: newtelligence dasBlog 1.9.6264.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts