SQL Services Start up and Shut Down
Hi!,
My question is :
1. How do I create a script to Start and Stop MSSQL 2000 services ?
Thank you.
Sundar Raj.
Software
Hi!,
My question is :
1. How do I create a script to Start and Stop MSSQL 2000 services ?
Thank you.
Sundar Raj.
by joseph moore
NET STOP MSSQLSERVER
That will stop the default SQL server service. If you have a named instance of SQL Server 2000, it would be:
NET STOP MSSQL$INSTANCENAME
where you would replace INSTANCENAME with the named instance name. For example, I have an instance called TESTING. So, I would type in NET STOP MSSQL$TESTING.
Now, to start the service, just type:
NET START MSSQLSERVER
To stop the SQLServerAgent, just do NET STOP SQLSERVERAGENT , or NET STOP SQLAGENT$INSTANCENAME to stop the named instance Server Agent.
Now, just make a simple .BAT file, with the stop or start line it it. Then, when you need to stop or start either service, just double-click the .BAT file.
Easy!
hope this helps
by sunder_raj
by 2farqm
If you are worried about the services stopping and not automatically restarting you can do the following.
Under Control Panel > Service right click each service and select properties. Under the recovery tab you can set it so that after failure the service restarts automatically. Otherwise just script the .bat file as explained already and use the scheduler to execute the program e.g. start up each morning at 7am and shutdown each evening at 2300
by sunder_raj
by sunder_raj
This discussion is closed to new replies.
Sort by Trending