Ask the Expert

What are Event Notifications?

What are Event Notifications?

    Requires Free Membership to View

Event Notifications is a feature similar to DDL triggers but with slightly different capabilities. The most important difference is that Event Notifications uses SQL Service Broker to asynchronously deliver messages, rather than working in the scope of the transaction, as do DDL triggers. This means that whether or not the transaction completes, the Event Notification will still be delivered. Likewise, it means that Event Notifications have no control over the transaction, and cannot be used to restrict operations—no rollback is possible within a notification.

Like DDL triggers, Event Notifications can fire on database or server-level DDL operations. However, Event Notifications also has the capability of firing on trace events. For instance, an Event Notification can be created that will fire any time a deadlock event occurs. This capability offers a lot of flexibility for capturing server events, which was only possible via traces previously.

Also similar to DDL triggers, Event Notifications uses the EVENTDATA function for programmatic access to information about the event that fired the notification.

Event Notifications can be used instead of DDL triggers whenever asynchronous activities make more sense than transaction control. For instance, if you need to log a certain event, but do not need the ability to roll back the transaction if something isn't correct, Event Notifications are probably a better choice.


Do you have comments on this Ask the Expert Q&A? Let us know.

This was first published in December 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: