Automated job to stop and start SQL Service

  • Hi there,

    Does anyone have a automated script that can stop and start a SQL Service?

    Regards

    IC

  • @ECHO OFF

    NET STOP SQLSERVERAGENT

    NET STOP MSSQLSERVER

    NET START MSSQLSERVER

    NET START SQLSERVERAGENT

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • It should be noted that if you're using a named instance, you'll have to modify MSSQLSERVER and SQLSERVERAGENT to the correct service names. Also, the sc command can be used, especially if you need to stop and start remotely.

    K. Brian Kelley
    @kbriankelley

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

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