Saturday, February 25, 2012

backups

I am in search of a simple .bat file or .vbs script that I can use to
stop my SQL database server. I am looking to schedule a script of sorts
to initiate at a certain time every day. This script needs to be able to
stop my server and/or initiate a backup. The script should be able to be
ran remotely from the lan. can anyone help me?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!"jeff wilmoth" <jeff_wilmoth@.yahoo.com> wrote in message
news:40185174$0$70300$75868355@.news.frii.net...
> I am in search of a simple .bat file or .vbs script that I can use to
> stop my SQL database server. I am looking to schedule a script of sorts
> to initiate at a certain time every day. This script needs to be able to
> stop my server and/or initiate a backup. The script should be able to be
> ran remotely from the lan. can anyone help me?

First question, why not use the online backup capabilities of SQL Server?

In any case, a simple

NET STOP MSSQLSERVER

and

NET START MSSQLSERVER

will stop and start SQL Server

If you have SQL Server Agent running, you can either do:

NET STOP SQLSERVERAGENT
NET STOP MSSQLSERVER

or

NET STOP MSSQLSERVER /Y

And then to start either

NET START MSSQLSERVER
NET START SQLSERVERAGENT

or simply

NET START SQLSERVERAGENT

which should start SQL Server first.

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

No comments:

Post a Comment