Can Instead Of triggers co-exist with regular triggers? If so, are there any potential issues we should be aware of?
Can Instead Of triggers co-exist with regular triggers? If so, are there any potential
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
INSTEAD OFtriggers can coexist with normal triggers. I’ve done this a good bit.INSTEAD OFtriggers have numerous potential issues, mainly around the fact that what they replace the normal insert/update/delete behavior with whatever you define. A developer may think nothing ofUPDATE User SET Address = 'foo' WHERE UserID = 4, but if your trigger is using that as a hook to touch a dozen authentication tables and maybe talk to a server around the world, you’ve bought yourself a lot of potential confusion.Keep the behavior of these triggers inline with expected behavior of IUD statements. Don’t do too much.
INSTEAD OFtriggers are a very powerful tool, easily misused. Use them appropriately and thoughtfully.