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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 last inserted, updated or deleted?

Author  Topic 

getur.srikanth@gmail.com
Yak Posting Veteran

77 Posts

Posted - 2008-03-14 : 17:42:24
How can we capture the last inserted, updated or deleted ID from the database ?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-03-14 : 17:43:53
Do you mean from a particular table?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-14 : 17:51:29
Most likely with a trigger.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

getur.srikanth@gmail.com
Yak Posting Veteran

77 Posts

Posted - 2008-03-14 : 18:13:59
capture the last inserted, updated or deleted ID from the Database and immediate scope of a stored procedure. Is there any specific way to do this?


quote:
Originally posted by Peso

Most likely with a trigger.



E 12°55'05.25"
N 56°04'39.16"


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-03-14 : 18:41:51
You need to explain in better detail as your problem doesn't make sense yet.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -