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.
| Author |
Topic |
|
baze7
Yak Posting Veteran
58 Posts |
Posted - 2010-02-26 : 17:11:16
|
| How can I trigger on an update of a field?If I have a table named Job and a field named complete, how can I trigger if the complete field changes from 0 to 1?ThanksChad |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2010-02-26 : 18:53:43
|
| [CODE]create trigger tu_MyTable_RisingEdgeon dbo.MyTablefor updateasif exists( select * from MyTable t inner join deleted d on d.PrimaryKey = t.PrimaryKey where d.Complete = 0 and t.Complete = 1 )begin <Your code goes here>end[/CODE]=======================================Few things are harder to put up with than the annoyance of a good example. (Mark Twain) |
 |
|
|
|
|
|