Export (0) Print
Expand All

Triggers and Event Notification Transact-SQL Enhancements

SQL Server 2005

Microsoft SQL Server 2005 introduces DDL triggers and event notifications.

DDL triggers, like their standard counterparts, execute stored procedures in response to an event. But unlike standard triggers, DDL triggers execute in response to DDL statements. DDL statements are primarily statements that start with CREATE, ALTER, and DROP. DDL triggers are used for administrative tasks, such as auditing and regulating database operations.

Event notifications execute in response to DDL and data manipulation (DML) statements and also trace events, but do not execute stored procedures. Instead, event notifications send information about a server event to a service broker, and are used to log and review changes or activity occurring on the database.

New statements Description

CREATE EVENT NOTIFICATION

Creates an event notification that sends information about a server event to a service broker.

DROP EVENT NOTIFICATION

Removes an event notification from the current database.

Enhanced statements Description

CREATE TRIGGER

Allows for creating a DDL trigger.

ALTER TRIGGER

Allows for modifying a DDL trigger.

DROP TRIGGER

Includes special syntax for removing a DDL trigger from the current database.

eventdata

Returns information about server or database events. The EVENTDATA function is used inside the body of a DDL trigger or event notification.

Community Additions

ADD
Show:
© 2014 Microsoft