Search code examples
sqlsql-serversql-agent-jobsql-agent

SQL Server Agent - Is there the ability to comment out multiple jobs in a single step?


I have a SQL Server Agent job that has a number of separate steps. Within some of these steps I have multiple exec statements that fire off stored procedures to populate tables. My question is this: Is there a means to comment out some of these exec statements? Currently I am deleting lines while working on changes and reinstating them once the changes have been completed. I don't have a test environment to experiment with. Thanks


Solution

  • The script of the job is standard TSQL. You can use comments like --, // or /* ... */ to comment out execs you don't want to run.

    If you use the Management Studio, you can hit the Parse button left of the script to check your syntax.