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 |
|
vladimir_grigoro
Yak Posting Veteran
62 Posts |
Posted - 2003-05-29 : 09:41:03
|
| Hi All,I want to make a trigger, which will fire when there is an update just of the 3rd column in a table. Example:Table AID int IDENTITYX CHAR(11)Y CHAR(3)I am trying to use such syntax to move the updated record into archive table but it don't work:CREATE TRIGGER UPD_AON AFOR UPDATE ASIF (COLUMNS_UPDATED() & 4) > 0BEGININSERT A_ARCHIVE ... ...FROM deleted delENDIs there any idea about potential solution? I am using SQL Server 2000.Thank you in advance.The RebelEdited by - vladimir_grigoro on 05/29/2003 09:43:09 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-05-29 : 13:31:59
|
| I think this is what you are looking for:CREATE TRIGGER UPD_A ON TableA FOR UPDATE AS IF UPDATE(ColY)BEGIN INSERT A_ARCHIVE ... ... FROM deleted del END Hope this helps!Owais |
 |
|
|
|
|
|