This guide shows you how to stop and start the SQL Server service on Windows, whether you need to apply a configuration change, recover from a hang, or perform routine maintenance. You will learn several methods—SQL Server Configuration Manager, Services console, Command Prompt, and PowerShell—so you can pick the one that fits your environment. No prior experience is needed, just administrative rights on the machine.
What You’ll Need
- Windows administrative account (local admin or a login with rights to manage services).
- The name of the SQL Server instance (e.g., MSSQLSERVER for default, SQLEXPRESS for a named instance).
- Optional: SQL Server Management Studio (SSMS) if you prefer a GUI, but it is not required.
Step-by-Step
- Identify your SQL Server instance name. Open a command prompt and type
sqlcmd -Lto list local instances, or check Windows Services (Win+R, typeservices.msc, Enter) and look for entries that start with “SQL Server (�. The text in parentheses is the instance name—for example, “SQL Server (SQLEXPRESS)� means the instance is SQLEXPRESS. - Open SQL Server Configuration Manager (recommended). Press Win+R, type
SQLServerManager16.msc(for SQL Server 2022), or search for “SQL Server Configuration Manager� in the Start menu. If you are unsure of the version, use the Services console instead (next step). - Stop the service. In Configuration Manager, expand “SQL Server Services� in the left pane. In the right pane, right-click the service you want (e.g., “SQL Server (MSSQLSERVER)�) and select Stop. A red icon appears while it is stopped.
- Start the service. Right-click the same service again and select Start. The icon turns green when it is running.
- Alternative: Use the Services console. Press Win+R, type
services.msc, and press Enter. Scroll to “SQL Server (instance name)�. Right-click and choose Stop or Start. You can also click the “Stop� or “Start� link on the left sidebar after selecting the service. - Alternative: Use Command Prompt (admin). Open Command Prompt as administrator (right-click Start, select “Command Prompt (Admin)� or “Terminal (Admin)�). Use the
netcommand with the exact service name. For a default instance:net stop MSSQLSERVERandnet start MSSQLSERVER. For a named instance like SQLEXPRESS:net stop MSSQL$SQLEXPRESSandnet start MSSQL$SQLEXPRESS. - Alternative: Use PowerShell (admin). Open PowerShell as administrator. Use
Stop-Service -Name 'MSSQLSERVER'andStart-Service -Name 'MSSQLSERVER'. For named instances, the service name isMSSQL$InstanceName(e.g.,MSSQL$SQLEXPRESS). - Verify the service state. After starting, check that the service is actually running. In Services or Configuration Manager, the status column should show “Running�. In PowerShell, run
Get-Service -Name 'MSSQLSERVER'and confirm the Status is “Running�. - Test connectivity. Open SQL Server Management Studio and try to connect to the instance. If you do not have SSMS, use
sqlcmd -S localhost(orsqlcmd -S .\SQLEXPRESSfor a named instance) and run a simple query likeSELECT @@VERSIONto confirm the server responds.
Common Mistakes
- Using the wrong service name. The default instance service is
MSSQLSERVER, but named instances areMSSQL$InstanceName. Using justMSSQLSERVERfor a named instance will fail. - Stopping the SQL Server Agent instead of the database engine. Agent is a separate service (e.g., SQLSERVERAGENT). Stopping Agent does not stop the database engine, and stopping the engine will also stop Agent if it is set to depend on it.
- Forgetting to run as administrator. The Services console and net commands require elevated privileges. If you get “Access denied�, close and reopen as administrator.
- Stopping the service while users are connected. This will forcibly disconnect all sessions and may cause data loss if transactions are not committed. Always plan maintenance windows.
- Not waiting for the service to fully stop. The service may take a few seconds to shut down cleanly. If you try to start it immediately, you might get an error. Wait for the status to show “Stopped� before starting again.
Tips
- Use Configuration Manager for SQL Server services. It shows the correct service names and handles SQL Server-specific dependencies better than the generic Services console.
- Set the startup type to Automatic. In the service properties, ensure “Startup type� is “Automatic� so the service starts when Windows boots, unless you have a reason to start it manually.
- Use a script for repeated tasks. If you often stop/start services, create a .bat or .ps1 file with the commands, but be careful with security.
- Check the SQL Server error log. After a restart, look at the error log (in SSMS under Management > SQL Server Logs) to confirm a clean shutdown and startup, and to spot any errors.
- Stop related services first. If you are stopping the database engine, consider stopping SQL Server Agent, Reporting Services, or Integration Services first to avoid error messages during shutdown.
Troubleshooting
- Service does not stop. If the service hangs, wait a few minutes. If it still does not stop, you can force it by opening Command Prompt as admin and running
taskkill /F /PID(find the PID withtasklist | findstr sqlservr), but this is a last resort and may cause corruption. Better to usenet stopwith a timeout:net stop MSSQLSERVER /y(the /y forces dependent services to stop). - Service does not start. Check the Windows Event Viewer (Applications and Services Logs > Microsoft > Windows > SQL Server) for error messages. Common causes: file permissions on data files, insufficient memory, or a corrupted configuration. Try starting via Configuration Manager to see a more detailed error.
- “Error 5: Access denied� when using net. This means you are not running as administrator. Right-click Command Prompt and choose “Run as administrator�.
- “The specified service does not exist� when using net. The service name is wrong. Check the exact name in Services (look for “SQL Server (InstanceName)�) and use
MSSQL$InstanceNamefor named instances. - SQL Server starts but you cannot connect. Check that the SQL Server Browser service is running (if using a named instance and dynamic ports). Also verify that TCP/IP is enabled in SQL Server Network Configuration in Configuration Manager.
- Configuration Manager is missing. On newer Windows versions, it may not be installed by default. You can install it via SQL Server setup, or just use the Services console or PowerShell.
Frequently Asked Questions
Will stopping SQL Server delete my databases?
No. Stopping the service only stops the database engine process. Your data files (.mdf and .ldf) remain on disk and are fully intact. When you start the service again, the databases come back online.
Can I stop SQL Server while users are connected?
Yes, but it will forcefully disconnect all users. Any uncommitted transactions are rolled back. It is better to notify users and plan the maintenance during low activity.
How do I find the service name for a named instance?
Open the Services console (services.msc) and look for “SQL Server (InstanceName)�. The service name is MSSQL$InstanceName (e.g., MSSQL$SQLEXPRESS).
What is the difference between SQL Server service and SQL Server Agent?
The SQL Server service is the core database engine that stores and processes data. SQL Server Agent is a separate service that runs scheduled jobs, alerts, and automation. You can stop them independently, but Agent depends on the engine.
Can I restart SQL Server from SSMS?
Yes. In SSMS, right-click the server in Object Explorer and select “Restart�. This will stop and start the service automatically. You must have appropriate permissions.
Why does the service take a long time to stop?
SQL Server performs a clean shutdown, which includes checkpointing all databases (writing dirty pages to disk) and closing connections. Large databases or heavy activity can make this take a while. Do not force-kill the process unless absolutely necessary.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Google Desktop Search Widget on Windows 11
- How to Build a Computer Stand (Saturday Workshop)
- Customize Touch Keyboard Themes in Windows 11
- Excel Pivot Table: Change Multiple Field Settings
- WhatsApp: How to Block Unknown Numbers
- How to Exit Vi in Linux: A Simple Guide