question

tiwaryrohit143 avatar image
tiwaryrohit143 asked

Dynamic trigger for delete and insert

I want a script to create trigger dynamically. I have 100 tables and i need to create insert and delete trigger.

Thanks in advance.

Rohit

t-sqlsql-server-2012dynamic-sqltriggers
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·

What have you tried thus far?

0 Likes 0 ·

1 Answer

·
tiwaryrohit143 avatar image
tiwaryrohit143 answered

I have written for insert/update trigger. You can check the script attached. I will shortly write for delete. This will be helpful.

Cheerscreate-triger-dynamic.txt


10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.