September 17, 2002 at 12:58 pm
How would I write a trigger that updates a column in another table after the table with the trigger is updated.
thanks!
September 17, 2002 at 2:24 pm
create trigger mytrigger for update on Mytable as
if update (columnA)
begin
update TableB
set x = y
where z = a
end
Steve Jones
September 18, 2002 at 10:20 am
This did not work.
create trigger mytrigger for update on Mytable as
if update (columnA)
begin
update TableB
set x = a.columnA
from tableB b,mytable a
September 18, 2002 at 10:25 am
Guess...
CREATE TRIGGER MyTrigger ON MyTable
AFTER UPDATE
AS
IF UPDATE(ColumnA)
BEGIN
--Code
END
That should fire the trigger after the UPDATE has been applied to the base table.
Never used the AFTER parameter, so I assume this will work?!
Clive Strong
September 18, 2002 at 10:49 am
Worked great!!! thanks 🙂
-K
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply