Start, terminate, suspension, resume, and restart SQL Server services

Applies to: yesSQL Server (all supported versions) - Windows merely

This article describes how to start, stop, pause, resume, or restart the SQL Server Database Engine, the SQL Server Agent, or the SQL Server Browser service on Windows by using SQL Server Configuration Manager, SQL Server Direction Studio (SSMS), net commands from a control prompt, Transact-SQL, or PowerShell.

For SQL Server on Linux, see Showtime, finish, and restart SQL Server services on Linux.

Place the service

SQL Server components are executable programs that run as Windows services. Windows services can run without displaying whatever activity on the estimator screen and without user interaction on the control line.

Database Engine service

The Database Engine service tin be the default instance (limit one per computer) or can exist one of many named instances on the computer. Use SQL Server Configuration Director to find out which instances of the Database Engine are installed on the computer. The default instance (if you install it) is listed as SQL Server (MSSQLSERVER). Named instances (if you install them) are listed as SQL Server (<instance_name>). By default, SQL Server Express is installed equally SQL Server (SQLEXPRESS).

SQL Server Agent service

The SQL Server Amanuensis service executes scheduled authoritative tasks, which are called jobs and alerts. For more information, run across SQL Server Agent. SQL Server Agent is not available in every edition of SQL Server. For a list of features that are supported past the editions of SQL Server, see Features Supported by the Editions of SQL Server 2019.

SQL Server Browser service

The SQL Server Browser service listens for incoming requests for SQL Server resources and provides clients information almost SQL Server instances installed on the computer. A single case of the SQL Server Browser service is used past all instances of SQL Server installed on the computer.

Additional Information

  • If you lot pause the Database Engine service, users who are already continued can go on to work until their connections are cleaved, but new users can't connect to the Database Engine. Use Pause when yous want to wait for users to complete their work before y'all stop the service, which lets them complete transactions that are in progress. Resume allows the Database Engine to accept new connections again. The SQL Server Agent service cannot be paused or resumed.

  • The SQL Server Configuration Manager and SSMS display the electric current status of services past using the following icons.

SQL Server Configuration Manager SQL Server Management Studio (SSMS)
Started A green arrow on the icon next to the service proper noun A white pointer on a greenish circle icon next to the service proper noun
Stopped A red foursquare on the icon next to the service proper name A white square on a reddish circle icon side by side to the service proper noun
Paused 2 vertical blue lines on the icon side by side to the service name Two vertical white lines on a bluish circle icon next to the service proper name
Restarting A cherry square indicates that the service stopped, and then a greenish pointer indicates that the service started successfully None
  • You won't accept access to all possible options when using SQL Server Configuration Managing director or SSMS, depending on the country of the service. For instance, if the service is already started, Get-go is unavailable.

  • When running on a cluster, the SQL Server Database Engine service is best managed by using Cluster Ambassador.

Permissions

Past default, only members of the local administrator group can start, stop, pause, resume, or restart a service. To grant non-administrators the power to manage services, encounter How to grant users rights to manage services in Windows Server 2003. (The process is similar on other versions of Windows Server.)

Stopping the Database Engine by using the Transact-SQL SHUTDOWN command requires membership in the sysadmin or serveradmin fixed server roles, and is not transferable.

SQL Server Configuration Manager

Start SQL Server Configuration Managing director

On the Start card, select All Programs > Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager.

The SQL Server Configuration Manager is a snap-in for the Microsoft Management Console program, and it may not appear as an application in some versions of Windows. See SQL Server Configuration Manager for more data.

Start, stop, suspension, resume, or restart an instance of the SQL Server Database Engine

  1. Start SQL Server Configuration Managing director, using the instructions above.

  2. If the User Account Control dialog box appears, select Aye.

  3. In SQL Server Configuration Manager, in the left pane, select SQL Server Services.

  4. In the results pane, right-click SQL Server (MSSQLServer) or a named instance, and so select Commencement, End, Suspension, Resume, or Restart.

  5. Select OK to close the SQL Server Configuration Manager.

Start, stop, intermission, resume, or restart the SQL Server Browser or an instance of the SQL Server Agent

  1. Starting time SQL Server Configuration Manager, using the instructions higher up.

  2. If the User Account Control dialog box appears, select Yeah.

  3. In SQL Server Configuration Manager, in the left pane, select SQL Server Services.

  4. In the results pane, right-click SQL Server Browser, or SQL Server Amanuensis (MSSQLServer) or SQL Server Amanuensis (<instance_name>) for a named instance, and then select First, Cease, Pause, Resume, or Restart.

  5. Select OK to shut the SQL Server Configuration Manager.

Notation

SQL Server Agent cannot be paused.

SQL Server Management Studio

First, finish, break, resume, or restart an instance of the Database Engine

  1. In Object Explorer, connect to the instance of the Database Engine, right-click the case of the Database Engine you want to start, and and so select Get-go, Stop, Interruption, Resume, or Restart.

    Or, in Registered Servers, right-click the instance of the Database Engine you lot want to start, point to Service Control, and then select Offset, Cease, Interruption, Resume, or Restart.

  2. If the User Business relationship Control dialog box appears, select Yeah.

  3. When prompted if yous want to act, select Yes.

Start, end, or restart an instance of the SQL Server Agent

  1. In Object Explorer, connect to the instance of the Database Engine, right-click SQL Server Amanuensis, so select Start, Stop, or Restart.

  2. If the User Business relationship Control dialog box appears, select Yes.

  3. When prompted if y'all want to act, select Yes.

Command Prompt window using net commands

The SQL Server services tin can be started, stopped, or paused by using Windows net commands.

Start the default instance of the Database Engine

  • From a control prompt, enter 1 of the post-obit commands:

                      internet beginning "SQL Server (MSSQLSERVER)"                                  

    -or-

                      net beginning MSSQLSERVER                                  

Starting time a named instance of the Database Engine

  • From a command prompt, enter one of the following commands. Replace <instancename> with the name of the example you want to manage.

                      net offset "SQL Server (instancename)"                                  

    -or-

                      net get-go MSSQL$instancename                                  

Start the Database Engine with startup options

  • Add startup options to the end of the cyberspace start "SQL Server (MSSQLSERVER)" statement, separated by a space. When started using net start, startup options use a slash (/) instead of a hyphen (-).

                      net start "SQL Server (MSSQLSERVER)" /f /m                                  

    -or-

                      net start MSSQLSERVER /f /m                                  

First the SQL Server Agent on the default instance of SQL Server

  • From a control prompt, enter 1 of the following commands:

                      cyberspace commencement "SQL Server Agent (MSSQLSERVER)"                                  

    -or-

                      internet first SQLSERVERAGENT                                  

Start the SQL Server Agent on a named case of SQL Server

  • From a control prompt, enter one of the post-obit commands. Replace instancename with the proper noun of the case you want to manage.

                      net offset "SQL Server Agent (instancename)"                                  

    -or-

                      net start SQLAgent$instancename                                  

For information about how to run SQL Server Agent in verbose mode for troubleshooting, see sqlagent90 Application.

Start the SQL Server Browser

  • From a command prompt, enter one of the following commands:

                      cyberspace offset "SQL Server Browser"                                  

    -or-

                      internet start SQLBrowser                                  

To pause or stop services from the Command Prompt window

  • To pause or finish services, modify the commands in the following ways.

  • To break a service, supervene upon cyberspace showtime with cyberspace pause.

  • To stop a service, replace net get-go with utilize cyberspace stop.

Transact-SQL

The Database Engine tin can be stopped past using the SHUTDOWN argument.

To stop the Database Engine using Transact-SQL

  • To wait for currently running Transact-SQL statements and stored procedures to finish, and then stop the Database Engine, execute the post-obit statement.

                      SHUTDOWN;                                  
  • To cease the Database Engine immediately, execute the following statement.

                      SHUTDOWN WITH NOWAIT;                                  

For more data about the SHUTDOWN statement, run across SHUTDOWN (Transact-SQL).

PowerShell

Showtime and end Database Engine services

  1. In a Command Prompt window, beginning SQL Server PowerShell by executing the following control.

                      sqlps                                  
  2. At a SQL Server PowerShell control prompt, by executing the following command. Supersede computername with the name of your calculator.

                      # Go a reference to the ManagedComputer class. CD SQLSERVER:\SQL\computername $Wmi = (go-item .).ManagedComputer                                  
  3. Place the service that y'all want to cease or start. Pick one of the post-obit lines. Replace instancename with the name of the named instance.

    • To get a reference to the default example of the Database Engine.

                            $DfltInstance = $Wmi.Services['MSSQLSERVER']                                          
    • To become a reference to a named instance of the Database Engine.

                            $DfltInstance = $Wmi.Services['MSSQL$instancename']                                          
    • To go a reference to the SQL Server Amanuensis service on the default instance of the Database Engine.

                            $DfltInstance = $Wmi.Services['SQLSERVERAGENT']                                          
    • To get a reference to the SQL Server Agent service on a named example of the Database Engine.

                            $DfltInstance = $Wmi.Services['SQLAGENT$instancename']                                          
    • To go a reference to the SQL Server Browser service.

                            $DfltInstance = $Wmi.Services['SQLBROWSER']                                          
  4. Complete the example to start and so stop the selected service.

                      # Display the state of the service. $DfltInstance # Outset the service. $DfltInstance.Get-go(); # Await until the service has fourth dimension to first. # Refresh the cache.   $DfltInstance.Refresh(); # Display the land of the service. $DfltInstance # Cease the service. $DfltInstance.Stop(); # Wait until the service has time to stop. # Refresh the cache. $DfltInstance.Refresh(); # Display the state of the service. $DfltInstance                                  

Use the ServiceController class

You tin utilize the ServiceController class to programmatically control the SQL Server service, or any other Windows service. For an example using C#, see ServiceController Class.

Adjacent steps

  • Overview of SQL Server Setup Documentation
  • View and Read SQL Server Setup Log Files
  • SQL Server Configuration Manager
  • Start SQL Server with Minimal Configuration