Sunday, February 12, 2012

Command Line SQL Server Shutdown??

I need to write a script to run at a specific time to shutdown a
SQL Server. I also need to start the SQL Server back up.
Does anyone know the command line that could be used in a BAT script
to shutdown and then restart a SQL Server v.7
Please reply via email and post
Thanks in Advance,
JohnJohn,
You can use NET STOP and NET START, as in
net stop MSSQLServer
net start MSSQLServer
Please note that if sqlserveragent is dependent, then stop that service
first before stopping SQLServer service.These commands are documented in
BooksOnLine.
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"John" <jkimb@.kimberlyconsulting.com> wrote in message
news:pan.2004.05.07.21.19.25.367752@.kimberlyconsulting.com...
> I need to write a script to run at a specific time to shutdown a
> SQL Server. I also need to start the SQL Server back up.
> Does anyone know the command line that could be used in a BAT script
> to shutdown and then restart a SQL Server v.7
> Please reply via email and post
> Thanks in Advance,
> John
>|||"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:uEvi3qHNEHA.2064@.TK2MSFTNGP12.phx.gbl...
> John,
> You can use NET STOP and NET START, as in
> net stop MSSQLServer
> net start MSSQLServer
> Please note that if sqlserveragent is dependent, then stop that service
> first before stopping SQLServer service.These commands are documented in
> BooksOnLine.
In that case net stop mssqlserver /y also stops dependent services

No comments:

Post a Comment