How to script alerts using Transact-SQL (Enterprise Manager)
To script alerts using Transact-SQL
- Right-click Alerts; then click All Tasks/Script All Alerts.
- In the Generate SQL Script dialog box, in the File name box, enter a name for the script.
- Under File format, select:
- MS-DOS text (OEM) to save the script in OEM format.
- Windows text (ANSI) to save the script in ANSI format.
- International text (Unicode) to save the script in Unicode format.
- Under SQL generation options, select:
- Replace alert if it exists to include in the script commands to delete any alerts with the same name as jobs generated by the script.
- Include notifications sent by alerts to the operator to include in the script commands to generate alert assignments for the operators generated by the script.
- Include the name of the job executed by the alert to include in the script commands to provide the name of the job executed by the alert.
- Enter a T-SQL batch separator. Include the name of the job executed by the alert to have the alerts generated by the script reference their response jobs. The default is GO.
(c) 1988-98 Microsoft Corporation. All Rights Reserved.