Hello,
I have 1 table that looks like this
Table XItem {
TransactID
TransactStatus nVarchar
TransactStatusId Int
This is all done in a MS SQL 2000 backend
What I want to do is when a user updates either TransactStatus or TransactStatusID I would like the field to update the the other field as well all with Triggers
for example
If TransactStatus = 1 then TransactStatusID = 1
If TransactStatusID = 2 then TransactStatus = 2
If you are wondering why I would want to do something like this, its a small patch/workaround and handy to know in the future
Thanks
PS this is the trigger code i got so far but it doesn't work
CREATE TRIGGER XItemActionsBandAid ON [dbo].[XItemActions]
FOR UPDATE AS
If update(TransActionStatus)
update X set X.TransActionStatusID = 2 from XItemActions X WHERE X.TransactionID <> (Select TransactionID from inserted)
"Sleep is the best meditation." - Dalai Lama
I have 1 table that looks like this
Table XItem {
TransactID
TransactStatus nVarchar
TransactStatusId Int
This is all done in a MS SQL 2000 backend
What I want to do is when a user updates either TransactStatus or TransactStatusID I would like the field to update the the other field as well all with Triggers
for example
If TransactStatus = 1 then TransactStatusID = 1
If TransactStatusID = 2 then TransactStatus = 2
If you are wondering why I would want to do something like this, its a small patch/workaround and handy to know in the future
Thanks
PS this is the trigger code i got so far but it doesn't work
CREATE TRIGGER XItemActionsBandAid ON [dbo].[XItemActions]
FOR UPDATE AS
If update(TransActionStatus)
update X set X.TransActionStatusID = 2 from XItemActions X WHERE X.TransactionID <> (Select TransactionID from inserted)
"Sleep is the best meditation." - Dalai Lama