Modifying a Trigger : Alter Trigger « Trigger « SQL Server / T-SQL Tutorial






4>
5>
6>
7> Create TRIGGER srv_trg_RestrictNewLogins
8> ON ALL SERVER
9> FOR CREATE_LOGIN
10> AS
11> SET NOCOUNT ON
12> PRINT 'Your login creation is being monitored.'
13> GO
1>
2>
3> ALTER TRIGGER srv_trg_RestrictNewLogins
4> ON ALL SERVER
5> FOR CREATE_LOGIN
6> AS
7> SET NOCOUNT ON
8> PRINT 'Your login creation is being monitored.'
9> INSERT YourDatabaseName.dbo.MyAudit
10> (EventData, DBUser)
11> VALUES (EVENTDATA(), USER)
12> GO
1>
2> drop trigger srv_trg_RestrictNewLogins
3> GO








22.2.Alter Trigger
22.2.1.The syntax of the ALTER TRIGGER statement
22.2.2.ALTER a TRIGGER
22.2.3.Modifying a Trigger
22.2.4.Auditing Triggers