Skip to main content

How to Start and Stop SQL Server Service from a Command Prompt

Microsoft SQL Serverv

EnvironmentvvCommand Prompt (DOS Window)

Option 1

STOP:

default instance: net stop mssqlserver

named instance: net stop mssql$instance_name

example: net stop mssql$ion

START:

default instance: net start mssqlserver

named instance: net start mssql$instance_name

example: net start mssql$ion

  1. Open a Command Prompt with administrative rights (run as administrator).
  2. Type the required command.
  3. Type 'Y' to proceed and press 'Enter' key.

NOTE: For the stop command, there will be a message that dependent services will stop as well. This includes SQL Server Agent and ION (In case PME is installed on the same server as SQL Server) services.

Option 2

REM This is for a default instance
NET STOP MSSQLSERVER
NET START MSSQLSERVER
REM Or you can use this one, just remove the REM and any other statements not needed
REM NET STOP "SQL Server (MSSQLSERVER)"
REM NET START "SQL Server (MSSQLSERVER)"
REM Or if you have a named instance use this
REM NET STOP MSSQL$INSTANCENAME
REM NET START MSSQL$INSTANCENAME
PAUSE