Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have SQL Server disabled on my machine and have to manually go into services (services.msc) to enable it and the agent. I'd like to write a batch script that I can run to enable them for me. Is it possible? When I do net start in the command prompt I don't see it listed so I'm not sure if it's possible.

EDIT: I'm using Windows Vista. I keep it disabled because having it run all the time slows my comp down and not all my web dev requires it. I'm more productive with it off most of the time because it is so resource intensive, especially for boot time.

share|improve this question
add comment

3 Answers

Which operating system?

And why do you keep it disabled?
Shouldn't it be enough to set it to manual startup and then simply start/stop it when needed?

Update

You're confusing "disabled" with "stopped".
If a service is enabled but set to manual startup, it won't start automatically, and it will always stay stopped unless you explicitly start it.
If it's set to "disabled", it will not start ever, and even you will not be able to start it, if you don't change its startup to manual or automatic.

So, just set it to "manual" and start/stop it when needed; it will not be running, unless you ask it to.

share|improve this answer
1  
+1 my thoughts also –  cop1152 Sep 9 '09 at 13:19
add comment

If you set the service to manual, you can create a batch file or two to start and stop it without going into the services menu. The commands would be:

net start SQLAgent$instancename

net stop SQLAgent$instancename

Example would be net start SQLAgent$MICROSOFTSMLBIZ for a BCM instance.

Similar to the agent, the server itself would be:

net start MSSQL$instancename net stop MSSQL$instancename

share|improve this answer
add comment

First, I would try to control the memory utilization of the instance (limit it to 75 MB, for example) AND increase the RAM in your computer (Vista is awful about RAM).

Otherwise, I'd go with Dan's suggestion for starting and stopping SQL.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.