Search code examples
sql-serverdatabasepowershellcommand-linesqlcmd

What's the best way to start and stop SQL Server from the command line?


I need to start and stop SQL Server from the command line. I am willing to write a small C# program if necessary, but I suspect that there's something (PowerShell, maybe?) that currently exists that does this gracefully.

Thank you.


Solution

  • net {start|stop} mssqlserver