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 2008 Forums
 Other SQL Server 2008 Topics
 Trigger Query

Author  Topic 

veggiop
Starting Member

10 Posts

Posted - 2011-06-22 : 02:36:00
Hello,

Within a trigger on a table can we identify the value of column which is getting inserted? Example suppose there is a table emp with column id, suppose I insert 1 in the table, can i identify within the trigger that 1 was inserted?

Please let me know if you have any solution to this.

thanks

http://www.fivefingers.me/vibram/

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-06-22 : 03:07:03
At runtime a trigger knows the "temp" tables
- inserted -> holds inserted data on insert or the NEW data on update
- deleted -> holds the deleted data on delete or the OLD data on update
The structure of these tables is equal to the structure of the triggered table.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -