from example a do this in Vb.
scColor.CommandText = "Update Product Set Color" & WColor.Trim & "=" &
WcolorValue & " Where Product='" & VarPubProduct & "'"
In a Trigger how can I know wich column is update Color01 or Color02 or
color03?
thanksUse the UPDATE() function [available in triggers]. This only lets you
know that the column indicated in the function was updated in at least
one row of the update. Then you'll need to compare the inserted and
deleted virtual tables to get the rows that were actually updated.
e.g.
IF UPDATE(Color01)
insert into LogTable (product, color01_old, color01_new)
select d.product, d.color01, i.color01
from deleted d
join inserted i on d.product = i.product
where d.color01 <> i.color01
Miguel Arenas wrote:
> from example a do this in Vb.
> scColor.CommandText = "Update Product Set Color" & WColor.Trim & "=" &
> WcolorValue & " Where Product='" & VarPubProduct & "'"
> In a Trigger how can I know wich column is update Color01 or Color02 or
> color03?
> thanks
>|||Thank you. This was very helpful.
"Trey Walpole" wrote:
> Use the UPDATE() function [available in triggers]. This only lets you
> know that the column indicated in the function was updated in at least
> one row of the update. Then you'll need to compare the inserted and
> deleted virtual tables to get the rows that were actually updated.
> e.g.
> IF UPDATE(Color01)
> insert into LogTable (product, color01_old, color01_new)
> select d.product, d.color01, i.color01
> from deleted d
> join inserted i on d.product = i.product
> where d.color01 <> i.color01
>
> Miguel Arenas wrote:
>
No comments:
Post a Comment