Can anyone please tell me the difference between database level trigger and server level trigger in SQL Server ?
Thanks in advance.
SQL Server 2005 introduced DML Triggers that can be set to fire on your chosen DDL events such as CREATE_TABLE
, ALTER_TABLE
, DROP_TABLE
, ALTER_DATABASE
, CREATE_LOGIN
etc.
DDL Triggers can be set within 2 scopes:
See the full list of SQL Server DDL Trigger Events (including their scope) on msdn here.
Syntax of a DDL trigger:
CREATE TRIGGER [TriggerName]
ON [Scope (Server|Database)]
FOR [EventName...],
AS
-- code for your trigger response here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With