How to: Create an Alert Using an Error Number (SQL Server Management Studio)

This topic describes how to create a Microsoft SQL Server Agent alert that will be raised when an error of a specific number occurs.

To create an alert using an error number

In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

Expand SQL Server Agent.

Right-click Alerts and then click New Alert.

In the Name box, enter a name for this alert.

Check the Enable check box to enable the alert to run. By default, Enable is checked.

In the Typebox, click SQL Server event alert.

In the Database name list, select a database to restrict the alert to a specific database.

Click Error number, and then type a valid error number for the alert.

To restrict the alert to a particular character sequence, check the box corresponding to Raise alert when message contains, and enter a keyword or character string for the Message text. The maximum number of characters is 100.