They seem to be allowed as I can see both my insert triggers listed under the table with different names. Is it common or a bad practice? I am using SQL Server 2005
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.
Yes, you can definitely have more than one trigger for each operation, e.g.
AFTER INSERTorAFTER UPDATEetc. It does make sense to split up separate concerns into separate, small, manageable chunks of code.The one thing you cannot rely on is that they’ll be executed in a certain order – the order in which the triggers are indeed executed also doesn’t have to be stable, i.e. the same every time around.