SQLCMD Query to Disable jobs

  • Hi,

    I have a job named as Check Alert on all 200 servers including QA. I wanted to disable it in a single go rather than logging to each n every SQL Instance. What is the query to disable it from SQLCMD as I dont have much exposure to scripts.

  • From the top of my head, it would be

    😎

    EXEC dbo.sp_update_job @job_name = N'Job_Name',@enabled = 0

    GO

    From the command line

    sqlcmd -S server -d database -Q "EXEC dbo.sp_update_job @job_name = N'Job_Name',@enabled = 0"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply