HomeAboutWebHostingNetworkingContact

Hey Jones!

Technical Services

Hey Jones LLC
505 Poli St
Suite 301
Ventura, CA 93001
(800) 439-1472
info@heyjones.com

  • April 13, 2010 9:02 am

    How To Start/Stop SQL Server Through The Command Line

    I recently ran into an issue with a client where I couldn’t login to their SQL Server. I was able to access the data files, but because SQL locks the data files while it’s running, I had to find a way to stop the service remotely. I also included the method for stopping and starting the services locally. Note: be sure to run the stop command on the sqlserveragent service first, since trying to stop mssqlserver while the agent is running will throw an error.

    Locally

    net stop sqlserveragent

    net stop mssqlserver

    net start mssqlserver

    net start sqlserveragent

    Remotely

    sc \[SERVER] stop sqlserveragent

    sc \[SERVER] stop mssqlserver

    sc \[SERVER] start mssqlserver

    sc \[SERVER] start sqlserveragent