How to script jobs using Transact-SQL (Enterprise Manager)
To script jobs using Transact-SQL
- Expand SQL Server Agent, right-click Jobs, and then click Script All Jobs/Script All.
- 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 job if it exists to include in the scripts command to delete jobs that have the same names as the jobs generated by the script.
- Include target servers to include in the script commands to generate target server assignments. This option is available only when scripting multi-server jobs.
- Enter a T-SQL batch separator. The default is GO.
(c) 1988-98 Microsoft Corporation. All Rights Reserved.