dorothee
Newbie
Points: 5
More actions
April 20, 2002 at 2:53 am
#158232
Hi, i'm new to stored procedures. How can i write a procedure that appends data from table A to table B whenever there is an update in table A everytime? (like a trigger called everytime A updates B?)
Andy Warren
SSC Guru
Points: 119902
April 20, 2002 at 6:20 am
#427555
It's best done with a trigger. BOL has a pretty good section on them. You'll wan to do something like this:
create trigger i_tablename on tablename for update as
set nocount on
insert into tableb (f1,f2,etc) select f1, f2, etc from inserted
Andy
AndySQLAndy - My Blog!Connect with me on LinkedInFollow me on Twitter
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply