SQL trigger (update) query

create trigger

I am having two table B1 and T1 both having 6 columns.

Now i want to create trigger to update table B1 when T1 is updated

what should me my trigger. I have written this

create trigger trig on T1 on update
for each row

insert into B1 (c1,c2,c3,c4...) values(1,2,3,4,5,6);

In the above code I am having one doubt it will come insert or not.

I want the trigger for to update backup table B1 when ever temp table T1 is update.


Author: Shailesh 09 Aug 2010 Member Level: Gold   Points : 1

write a update condition in the trigger & take primary key in the update query.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: