Previous Thread:   Query Notification

3/10/2006 3:51:31 PM    CLR DML Trigger Question




3/11/2006 11:28:09 PM    Re: CLR DML Trigger Question
Hello William,  
  
Deploying a DDL trigger with Visual Studio isn't quite intutive. This seems  
  
to work for me:  
  
[Microsoft.SqlServer.Server.SqlTrigger(Name = "ddltrigger",Target="database",  
  
Event = "FOR DDL_DATABASE_LEVEL_EVENTS")]  
  
public static void ddltrigger()  
  
{  
  
// Replace with your own code  
  
SqlContext.Pipe.Send("Trigger FIRED");  
  
}  
  
So, Target should be either database|all_server, while the events are documented  
  
nicely in "Event Groups for Use with DDL Triggers" [0].  
  
[0]: http://msdn2.microsoft.com/en-us/library/ms191441.aspx  
  
Thank you,  
  
Kent Tegels  
  
DevelopMentor  
  
http://staff.develop.com/ktegels/