Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command line or even through the sql server studio to gracefully stop SQL Server 2005?

share|improve this question
up vote 3 down vote accepted

As mfinni said, net stop mssqlserver or similar will do it from the command line. To add to that, from the GUI in SSMS, you can right click the instance name and hit "Stop".

You can also stop/start/restart SQL from the SQL Configuration Manager application.

share|improve this answer
Just to be clear, this is a gentle friendly stop, meaning no data loss, all files are left in a consistent way? – Knox Feb 16 '10 at 20:17
Yes, issuing a net stop command initiates a graceful shut down of the service. – joeqwerty Feb 17 '10 at 2:01

You can also use Stop-Service -Force -Name 'MSSQL$SQLEXPRESS' if you want it in PowerShell. Substitute MSSQL$SQLEXPRESS with your SQL Server instance name.

share|improve this answer
Thank you for the powershell suggestion. If I do any scripting I generally use Powershell. But I'm not sure if I want to FORCE it to stop. I want to gently let it finish up whatever it's doing with no data lost and all files consistent. – Knox Feb 16 '10 at 20:16
So don't use -Force – mfinni Feb 16 '10 at 20:28
Well then you should stop all dependent services before running it. net stop would do this automatically, powershell won't. I used force just to stop those dependent services as well. – Parsa Feb 17 '10 at 2:53

If yout server on windows you can use command from cmd: SC STOP SERVICENAME and SC START SERVICENAME

ServiceName - you can resolve by SC commnad, or look in Services (Control Panel)


share|improve this answer
net stop <servicename>

Will do it. The servicename will depend on whether it's the default instance or named. Run net start to see what your currently-running services are named.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.