Hi friends,
Pls, Help me..
How to create trigger Procedure. I want to delete record one table the same value should be dynamically save in another table.
How to create the trigger procedure. Give me sample trigger procedure
Thanks
Hi friends,
Pls, Help me..
How to create trigger Procedure. I want to delete record one table the same value should be dynamically save in another table.
How to create the trigger procedure. Give me sample trigger procedure
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satish KathiRank #8,369 · 223 reputationPosted Aug 26, 2008, 1:20 PM EDT
Here is the sample code, when you delete from table1 trigger will insert the values in table2.
Hope this helps
create trigger tD_tD_tabl1 on table1 for DELETE
as
begin
declare
@da nvarchar(10),
@db nvarchar(10)
declare mycursor cursor for select a, b from deleted
open mycursor
fetch mycursor into @da, @db
while @@fetch_status <> -1
BEGIN
if @@fetch_status <> -2
BEGIN
insert into table2 (c,d) values(@da, @db)
END
fetch mycursor into @da, @db
END
close mycursor
end
kavitha m11 reputationPosted Aug 26, 2008, 9:12 PM EDT
Hi Satish Kathi ,
Given trigger procedure working fine. You given me exact coding. Thanks a lot
keep on answer my question. once again Thanks
shiva krishna4 reputationPosted Sep 26, 2008, 8:50 PM EDT