I want to copy a SQL Server Agent job (with TSQL type steps) from server A to server B.
When I do these steps:
- Click on the job I want to copy
- Select All Tasks then Generate SQL Script
- Enter a file name
- Click OK
I get the error:
"A job step's command contains the TSQL Batch separator 'GO'. This may cause problems while running the script generated by this dialog. Use a different TSQL Batch separator while executing the generated script.
If I paste the script into Query Analyzer, the syntax check errors out all over the place and won't run.
If in the TSQL job steps I change the batch separator from GO to something else, I can generate the script just fine, and I can run the script just fine (which successfully copies it to the new server). However, the job won't run since it has a bogus TSQL Batch separators.
Am I approaching this wrong or is this a "feature"? I can't find any information about this situation in books online or on the web.
Thanks.
When I do these steps:
- Click on the job I want to copy
- Select All Tasks then Generate SQL Script
- Enter a file name
- Click OK
I get the error:
"A job step's command contains the TSQL Batch separator 'GO'. This may cause problems while running the script generated by this dialog. Use a different TSQL Batch separator while executing the generated script.
If I paste the script into Query Analyzer, the syntax check errors out all over the place and won't run.
If in the TSQL job steps I change the batch separator from GO to something else, I can generate the script just fine, and I can run the script just fine (which successfully copies it to the new server). However, the job won't run since it has a bogus TSQL Batch separators.
Am I approaching this wrong or is this a "feature"? I can't find any information about this situation in books online or on the web.
Thanks.