Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Cowski
Starting Member
30 Posts |
Posted - 2010-04-27 : 12:22:43
|
Is there a trigger event out there that would trip if a stored procedure is altered/deleted? If so, what is it? I'm at my wits end with this search. Thanks!  |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
Cowski
Starting Member
30 Posts |
Posted - 2010-04-27 : 14:19:43
|
quote: Originally posted by visakh16 you can use DDL triggers for thathttp://msdn.microsoft.com/en-us/library/ms190989.aspx------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
I checked out the DDL aspect of it & found this note regarding DDL triggers:"DDL triggers do not fire in response to events that affect local or global temporary tables and stored procedures."Am I reading that right that DDL triggers don't do what I'm looking for?I found this as the 2nd note on this page: http://technet.microsoft.com/en-us/library/ms186406.aspx |
 |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-04-27 : 14:38:50
|
| This is the code i tried:Create TRIGGER ProcAlterCheck1ON DATABASE FOR create_PROCEDURE,Alter_procedureAS RAISERROR ('Checking the trigger',16,1) ROLLBACKgocreate procedure procTest1as Select * from DataTablePlease correct if my understanding is wrong or your requirement is something different.Regards,BohraI am here to learn from Masters and help new bees in learning. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-28 : 05:42:55
|
| it will get fired for create/alter proc , at least in 2008------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-04-28 : 11:01:35
|
| I have 2005 and its firing..So DDL trigger for Create / Alter sp is supported in 2005 alsoI am here to learn from Masters and help new bees in learning. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-28 : 11:06:49
|
| ok...i didnt had sql 2005 box to test then. thanks for confirming------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|