Skip to content
Advertisement

create sql trigger after insert

i have two tables first table orders_details with columns orders_id ,date, admin_id, comments

second table orders_tracking with columns orders_id ,date, admin_id

in orders_details i have duplicates of rows

i want to create trigger that after row insert to orders_details the c trigger check if order_id and admin_id already exist the date column update in orders_tracking (take the date from orders_details) otherwise do insert to otherwise

example orders_details

example orders_tracking

insert now in orders_details have new insert

update now in orders_details have new insert

then orders_tracking

Advertisement

Answer

step-1 : create a table orders_details

) ON [PRIMARY]

Need to more details visit : sql trigger after insert

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement