Use Transact-SQL to write a job script
You can generate a Transact-SQL script to create the defined job. By writing a job script, you can:
- Control job creationSource code.
- Migrate jobs from testing to production.
- Compile alert and operator scripts.
Scripts created on computers running Microsoft SQL Server 2000 instances can also be run on computers running SQL Server 7.0. If you select to create a script compatible with SQL Server 7.0, some SQL Server 2000 features will be ignored, such:
Use Transact-SQL to write a job script
Enterprise Manager
How to Use Transact-SQL to write job scripts (Enterprise Manager)
Use Transact-SQL to write a job script
- Expand the server group and then expand the server.
- Expand "management", and then expand "SQL Server proxyProgram".
- Right-click "job", point to the "all tasks" sub-menu, and click "generate SQL script" command.
- In the file name box, type the Script Name.
- Perform one of the following operations under "File Format:
- Click MS-DOS Text (OEM) "option to save the script in OEM format.
- Click the "Windows text (ANSI)" option to save the script in ANSI format.
- Click "international text" (UNICODE) "option to save the script in unicode format.
- Perform one or two of the following operations under "SQL Generation Options": (optional)
- Select the check box "replace a job if it already exists", which contains script commands to delete jobs with the same name as the job generated by the script.
- Select the "include target server" check box, which contains the script command used to generate the target server allocation. This option can be used only when writing a multi-server job script.
- In the tsql batch processing separator box, enter the transact-SQL batch processing separator.
Create SQL Server 7.0 compatible scripts
Enterprise Manager
how to create SQL Server 7.0 compatible scripts (Enterprise Manager)
Create a SQL Server 7.0 compatible script
- Expand the server group and then expand the server.
- Expand the "Database" folder.
- right-click the database, point to "all tasks", and click the "generate SQL script" command.
- on the "General" tab, click "show all" to display all objects for script writing.
- select the object type of the script to be written, or select the "compile all object scripts" check box.
- click the "format" tab and select the "write scripts for functions compatible with version 7.0" check box.
this option is only available on Microsoft SQL Server 2000 computers.
1988-2000 Microsoft Corporation. All rights reserved.