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
 Trigger question

Author  Topic 

jauner
Starting Member

19 Posts

Posted - 2009-08-05 : 14:37:50
I need to create an update trigger that when a value in a certain field is changed it records the date in another field as long as a type field is equal to a certain value.

Any ideas on how to do this?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-08-05 : 14:46:25
update yt
set another_field=d.certain_field
from your_table yt
join deleted d on d.yt_id = yt.yt_id
where yt.type_field = certain_value


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

- Advertisement -