MySQL triggers: after an update on table1, delete rows from table2? -


after update on table1, want delete data in table2. however, delete data in table2 need example, id can obtained update on table1. how can this?

table1 : table1_id pk, column1, column2 table2 : table2_id pk, table1_id fk, column 1

wabbit, 1 should you:

delimiter ///  create trigger name_of_the_trigger after update on table1     each row     begin             delete table2 t2 t2.table1_id = old.table1_id;     end; ///  delimiter ; 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -