Scripting Jobs and Alerts

Alerts and jobs can be quite complex and time consuming to set up and debug. Regular backups of the MSDB database—where the definitions for alerts and jobs are stored—will protect you against loss of these objects; however, it is also a good idea to script at least your most complex jobs. Scripting is also a good way to store versions of a job as it is modified. If the modification doesn't have the desired behavior, the script can be run to restore the previous version. Another use for scripts is to easily transfer jobs or alerts to another server. To generate a script for a job or alert, right-click it and select Generate SQL Script. Provide a name for the file and select the text format and whether the script should ...

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.