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
 Is it possible to get old and new record in after

Author  Topic 

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-06-03 : 02:48:53
Hi all,

Is it possible to get old and new record in after update trigger??

If yes, please advice me!




Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-03 : 02:52:49
Yes.
You have access to both the INSERTED and DELETED virtual tables.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-06-03 : 02:55:23
Hi peso,

I'm relatively new to triggers, will u guide me with some examples?


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2009-06-03 : 02:59:05
Check the entry in Books Online for CREATE TRIGGER. There are some examples there.

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

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-03 : 03:41:21

http://www.sqlteam.com/article/an-introduction-to-triggers-part-i


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-03 : 12:31:13
quote:
Originally posted by senthil_nagore

Hi all,

Is it possible to get old and new record in after update trigger??

If yes, please advice me!




Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled


if its sql 2005, you can also use OUTPUT operator to access INSERTED & DELETED tables to get old and new values.
Go to Top of Page
   

- Advertisement -