Everytime a stored proc is ALTERed or CREATEd, I want to capture that in a trigger to do some stuff afterwards.
Can I do that in SQL Server 2008?
Thank you.
–Beemer
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.
If you want to do somethin withing the ALTER/CREATE/DROP context (ie. inside the same transaction) and even prevent the ALTER/CREATE/DROP then you should look into DDL Triggers.
If you want to do something after the ALTER/CREATE/DROP , in a separate transaction, and have the liberty to do some lengthy processing without slowing down the original DDL, then you should look into Event Notifications.
Note that Event Notifications can actually be delivered remotely so you can capture all DDL events from an entire corporate group into one single central repository.