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 |
ATG
Starting Member
35 Posts |
Posted - 2012-05-22 : 19:13:28
|
I need a trigger that upon one field being updated, it takes that data and puts it into a different field in the same table.The SQL command would be:update Pset P.PurchaseAmt=P.EstimatedCostso I'd imagine the trigger would be something like...ALTER trigger dccPu on P AFTER UPDATE asBEGINif update(P.EstimatedCost)begin update P set P.PurchaseAmt=P.EstimatedCostendENDLogically that makes sense to me but it doesn't work. Also, the trigger will potentially have multiple "if update"s...Thanks :) |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
ATG
Starting Member
35 Posts |
Posted - 2012-05-22 : 20:04:25
|
Yes. I wasn't trying to actually execute this code. I've figured it out, however, and it works fine.Thanks! |
 |
|
|
|
|