June 14, 2009

Stop, Start, Pause and Resume a SQL Server Instance using net Commands

A user asked me recently if it was possible to start and stop a SQL Server Service using command line. The answer is YES and it is quite easy to do so as shown below:

Open your windows command prompt and type the following command to Stop, Start, Pause and Continue a SQL Server Instance.

Note: If you are running this on Vista or higher OS, you may have to run the command prompt as administrator. Go to Start > All Programs > Accessories > Right click Command Prompt > Run as Administrator

To Stop, Start, Pause and Resume a SQL Server Default Instance

Stop – net stop MSSQLSERVER

Start – net start MSSQLSERVER

Pause – net pause MSSQLSERVER

Continue – net continue MSSQLSERVER


To Stop, Start, Pause and Resume a SQL Server Named Instance

Note: I have a named instance called SUPROTIM2 on my machine.

Stop – net stop “SQL SERVER SUPROTIM2”

Start – net start “SQL SERVER SUPROTIM2”

Pause – net pause “SQL SERVER SUPROTIM2”

Continue – net continue “SQL SERVER SUPROTIM2”


About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal

No comments: