Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping a Service from CMD Line 1

Status
Not open for further replies.

SteveAudus

Technical User
Oct 4, 2001
409
GB
I'm sure people will suggest a better way of doing this, but
I need to copy some SQL Data files to backup, but first I have to stop the SQL server.

If I can do it from a command line I can schedule it to stop in the middle of the night, copied it and restart it.

Easy.... but what is the command for stopping a service?

Thanks for any help.

Steve Audus
Chaucer School

 
I know a great way to do it from the command line but I'm not going to detail it as it is a very poor way of doing it!

Instead, use the SQL backup utility (in fact use a maintenance plan to do other stuff as well) to drop the database to flat file and back up the flat file.

It is faster, much more reliable and can be done on the fly with all services running.

In SQL Enterprise, go to maintenance plan and there is a wizard - if you need help, drop a note in the relevant SQL forum.

<signature sold. new owner moving in shortly>
 
Zelandakh (MIS),

thanks for your suggestion, I do not have any access to SQL enterprise, I not even sure we have it.
We have a service called SQLAgent$SIMS

I know there is a SQL Server Service Manager at the right of the task bar running, and a service called
SQLAgent$SIMS which I need to stop to backup the files.

Any suggestions?

Thanks
Steve


 
SQL Enterprise Manager is an application that is part of SQL Server so you definitely have it.

It isn't a service, it is under Programs/SQL Server on the SQL box.

Don't stop the service - honestly, that is a bad way of doing it and you are seriously risking trashing your box.

<signature sold. new owner moving in shortly>
 
The command line option to stop a service is:

NET STOP &lt;service name&gt;

To start it again:

NET START &lt;service name&gt;

-Al

 
If you want to restart a service with one command, you can combine net stop and net start.

For example "net stop netlogon & net start netlogon" will restart the netlogon service.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top