User Id :
Stay Signed In
Write For Us
Topic: How to get the newly generated Id in the table in sql server 2005?
23 Nov 2010 at 02:49 AM
How to get the newly generated Id in the table in sql server 2005?
Re: How to get the newly generated Id in the table in sql server 2005?
16 Dec 2010 at 02:59 AM
SELECT SCOPE_IDENTITY ()
It returns the last IDENTITY value produced on a connection and by a statement in the same scope, regardless of the table that produced the value.
SCOPE_IDENTITY(), like @@IDENTITY, will return the last identity value created in the current session, but it will also limit it to your current scope as well. In other words, it will return the last identity value that you explicitly created, rather than any identity that was created by a trigger or a user defined function.
Total Replies: 1
Featured Text Ad
© 2017-2018 DotNetLogix. All rights reserved.
Privacy and Policy