Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how do u get the id of the row you just inserted

Author  Topic 

CoolDoor
Starting Member

1 Post

Posted - 2012-01-08 : 02:37:32
how do you get the identity id of the row you just inserted into a table

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-08 : 02:43:46
use SCOPE_IDENTITY

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-08 : 04:43:19
Or the OUTPUT clause.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -