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
 record id of row updated or deleted

Author  Topic 

bill_
Starting Member

38 Posts

Posted - 2009-04-24 : 11:43:03
Is there a way of getting the record id of a row that has just been updated or deleted? Something like @@identity for not for inserts?

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2009-04-24 : 11:58:59
In a trigger you can query the inserted and deleted pseudo tables. If you're on SQL 2005 or SQL 2008, look up the OUTPUT clause in Books Online.

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

- Advertisement -