locked
Proper way to turn on and off SQL Server 2014 RRS feed

  • Question

  • Hello to all,

    I installed SQL Server 2014 Express to aid in my Visual Studio 2015 project development.  For security reasons, when I'm not working on the development of my project, I'd like to turn off my SQL Server.  Of course, I'd like to start it back up when I begin coding once again.  What's the best way of doing this?  Rather, what is the proper way of doing this?

    Thanks to all

    Marcin


    MarcinMR

    Saturday, February 20, 2016 1:17 AM

Answers

  • Yes, I know about Services.msc, but doesn't SQL Server 2014 come with an app that lets you start and stop the server through it?  Using Services.msc seems like a round about way.

    Indeed, SQL Server comes with SQL Server Conifiguration Manager (SSCM), and you can use it to stop and start the service, just as well as the Services applet.

    My preference is to use SSCM for two reasons:

    1) Less clutter than in the Services applet.
    2) There are some other configuration changes that you should always perform from SSCM, for instance setting the service account. (Because SSCM takes care of granting the account necessary permissions.) So it is good to have the habit.

    If you are lazy you can issue SHUTDOWN command from SQL Server Management Studio. If you also are impatient you can say SHUTDOWN WITH NOWAIT. There is no T-SQL command to start SQL Server, though. :-)

    • Marked as answer by MarcinMR Sunday, February 21, 2016 11:03 PM
    Saturday, February 20, 2016 1:02 PM
  • Yes, I know about Services.msc, but doesn't SQL Server 2014 come with an app that lets you start and stop the server through it?  Using Services.msc seems like a round about way.

    The SQL Server Configuration manager (SQLServerManager12.msc in SQL 2014) console snap-in is another method to stop and start SQL Server with a UI.  It will allow you to manage SQL Server services running the SSCM version or earlier.  Like Erland said, SSCM should be used to make SQL Server configuration changes but, for simple service start and stop, it doesn't provide value other than avoid the clutter of showing non-SQL Server services.  You can also use the SSMS context menus in Object Explorer and Registered Servers to stop/start the SQL Server service using a UI.

    Of course there are many other methods to start and stop services on demand, such as the context menu in SSMS Object Explorer, Service Control Manager (SC.EXE), or Powershell.  If this is something you do often, consider creating a command files on the desktop with the start and stop commands to make quick work of it.



    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Marked as answer by MarcinMR Sunday, February 21, 2016 11:03 PM
    Saturday, February 20, 2016 1:27 PM
  • SQL Server runs as a service, which you can start when you need it and stop it when you don't.  Set the "SQL Server (SQLEXPRESS)" service to manual start so that it doesn't automatically start at boot using the Services console snap in (which can be launched by typing Services.msc from a command prompt).  You can start and stop it using that tool or with these commands from a command prompt:

    NET START MSSQL$SQLEXPRESS
    NET STOP MSSQL$SQLEXPRESS
    


    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Marked as answer by MarcinMR Sunday, February 21, 2016 11:02 PM
    Saturday, February 20, 2016 3:03 AM

All replies

  • SQL Server runs as a service, which you can start when you need it and stop it when you don't.  Set the "SQL Server (SQLEXPRESS)" service to manual start so that it doesn't automatically start at boot using the Services console snap in (which can be launched by typing Services.msc from a command prompt).  You can start and stop it using that tool or with these commands from a command prompt:

    NET START MSSQL$SQLEXPRESS
    NET STOP MSSQL$SQLEXPRESS
    


    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Marked as answer by MarcinMR Sunday, February 21, 2016 11:02 PM
    Saturday, February 20, 2016 3:03 AM
  • Yes, I know about Services.msc, but doesn't SQL Server 2014 come with an app that lets you start and stop the server through it?  Using Services.msc seems like a round about way.

    MarcinMR

    Saturday, February 20, 2016 4:36 AM
  • Yes, I know about Services.msc, but doesn't SQL Server 2014 come with an app that lets you start and stop the server through it?  Using Services.msc seems like a round about way.

    MarcinMR

    You dont need to worry about starting or stopping SQL Server , assuming its running on local machine when you are done with your work and saved everything just shutdown your local machine since SQL Server runs as service windows will shut it down gracefully.

    Its always better to have a look at SQL Server just in case you are not running anything when you shutdown.


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Wiki Articles

    MVP

    Saturday, February 20, 2016 5:30 AM
  • Yes, I know about Services.msc, but doesn't SQL Server 2014 come with an app that lets you start and stop the server through it?  Using Services.msc seems like a round about way.

    Indeed, SQL Server comes with SQL Server Conifiguration Manager (SSCM), and you can use it to stop and start the service, just as well as the Services applet.

    My preference is to use SSCM for two reasons:

    1) Less clutter than in the Services applet.
    2) There are some other configuration changes that you should always perform from SSCM, for instance setting the service account. (Because SSCM takes care of granting the account necessary permissions.) So it is good to have the habit.

    If you are lazy you can issue SHUTDOWN command from SQL Server Management Studio. If you also are impatient you can say SHUTDOWN WITH NOWAIT. There is no T-SQL command to start SQL Server, though. :-)

    • Marked as answer by MarcinMR Sunday, February 21, 2016 11:03 PM
    Saturday, February 20, 2016 1:02 PM
  • Yes, I know about Services.msc, but doesn't SQL Server 2014 come with an app that lets you start and stop the server through it?  Using Services.msc seems like a round about way.

    The SQL Server Configuration manager (SQLServerManager12.msc in SQL 2014) console snap-in is another method to stop and start SQL Server with a UI.  It will allow you to manage SQL Server services running the SSCM version or earlier.  Like Erland said, SSCM should be used to make SQL Server configuration changes but, for simple service start and stop, it doesn't provide value other than avoid the clutter of showing non-SQL Server services.  You can also use the SSMS context menus in Object Explorer and Registered Servers to stop/start the SQL Server service using a UI.

    Of course there are many other methods to start and stop services on demand, such as the context menu in SSMS Object Explorer, Service Control Manager (SC.EXE), or Powershell.  If this is something you do often, consider creating a command files on the desktop with the start and stop commands to make quick work of it.



    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Marked as answer by MarcinMR Sunday, February 21, 2016 11:03 PM
    Saturday, February 20, 2016 1:27 PM
  • I again repeat YOU DONT HAVE TO stop sql server before stopping windows machine unless you want to do extra work and when windows start and if startup type is automatic SQL will come online.

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Wiki Articles

    MVP

    Monday, February 22, 2016 8:00 AM
  • I again repeat YOU DONT HAVE TO stop sql server before stopping windows machine unless you want to do extra work and when windows start and if startup type is automatic SQL will come online.

    This is of course true but Marcin mentioned a desire to stop and start SQL Server on demand.


    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    Monday, February 22, 2016 12:03 PM