How To Manage ( Start \ Stop \ Pause \ Stop ) SQL Server Services From The Command Line


Command prompt gives us facility to start and and stop any service running on windows machine. If you want to do same in a remote system then you have to connect it remotely and do same.

We can  start, stop, and pause SQL Server as like other services.
To manage the SQL server instances from command prompt, use these commands:

For Default Instance:

/**** Starts SQL Server default instance ****/
NET START MSSQLSERVER 

/**** Stops SQL Server default instance ****/
NET STOP MSSQLSERVER 


/**** Pause SQL Server default instance ****/
NET PAUSE MSSQLSERVER

/**** Resume SQL Server default instance after pause. ****/
NET CONTINUE MSSQLSERVER


For Named Instance:


/**** Starts SQL Server named instance (replace instancename with actual sql instance name). ****/
NET START MSSQL$instancename

/**** Stops SQL Server named instance (replace instancename with actual sql instance name). ****/
NET STOP MSSQL$instancename













/**** Pauses SQL Server named instance (replace instancename with actual sql instance name). ****/
NET PAUSE MSSQL$instancename


/********************************/ 
“SQL Service has been paused, No New connections will be allowed” and if you try to connect, you will get below error
"SQL Server service has been paused. No new connections will be allowed.(Microsoft SQL Server, Error: 17142)"




/**** Resume SQL Server named instance after pause (replace instancename with actual sql instance name). ****/
NET CONTINUE MSSQL$instancename

No comments:

Post a Comment