Re: Script to stop a SQL service



> Would the syntax be the same if I ran the command line script from within
> a batch file?

Yes.

> I'm planning on running this batch file from within the BackUp Exec
> software. I have two database programs that run SQL services, preventing
> the backup jobs from doing a thorough job. Automatically shutting down
> those SQL services will allow jobs to complete properly.

Rather than cold backups, consider backing up your databases to disk using
Transact-SQL BACKUP DATABASE and then archiving the disk backup files to
tape using your backup software. This allows you to perform backups while
the databases are online and uses less tape storage. Many backup vendors
also provide a specialized backup agent for SQL Server that allows you to
backup SQL Server databases online.

In any case, be sure to thoroughly test your recovery procedure.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Paul O. Morris" <pomorris@xxxxxxxxxxx> wrote in message
news:Y_-dncZAa9tM3lbfRVn-hQ@xxxxxxxxxxxxxx
> Would the syntax be the same if I ran the command line script from within
> a batch file?
>
> I'm planning on running this batch file from within the BackUp Exec
> software. I have two database programs that run SQL services, preventing
> the backup jobs from doing a thorough job. Automatically shutting down
> those SQL services will allow jobs to complete properly.
>
>
> "Dan Guzman" <guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:Blyxe.3037$cb6.823@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> You can use the NET STOP and NET START commands from the command-prompt
>> to stop/start any Windows service. For a default SQL Server instance:
>>
>> NET STOP MSSQLSERVER
>> NET START MSSQLSERVER
>>
>> For a named instance:
>>
>> NET STOP MSSQL$MyInstance
>> NET START MSSQL$MyInstance
>>
>> You can also use SQL-DMO to stop/start a SQL Server instance. VbScript
>> Examples:
>>
>> 'stop example
>> Option Explicit
>> Dim oSQLServer
>> Set oSQLServer = CreateObject("SQLDMO.SQLServer")
>> oSQLServer.Name = "MyServer"
>> oSQLServer.Stop
>>
>> 'start example
>> Option Explicit
>> Dim oSQLServer
>> Set oSQLServer = CreateObject("SQLDMO.SQLServer")
>> oSQLServer.Start False, "MyServer"
>>
>> --
>> Hope this helps.
>>
>> Dan Guzman
>> SQL Server MVP
>>
>> "Paul O. Morris" <pomorris@xxxxxxxxxxx> wrote in message
>> news:K8GdnQw9easBP1vfRVn-gg@xxxxxxxxxxxxxx
>>> Is there a script that I can run to stop a particular SQL server service
>>> on Win2003 server? I'm looking for a similar script to restart that
>>> service as well. Thanks.
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Backup Script
    ... "Bill Stewart" wrote: ... >> or batch file because the backup media is an external HD, ... >> script or application and I want to make it as simple as possible. ...
    (microsoft.public.windows.server.scripting)
  • RE: build process
    ... > backup the SQL server db from the DB server ... > copy and restore the db backup to the local machine. ... > I started creating a batch file but I'm having problems connecting to VSS on ...
    (microsoft.public.vsnet.general)
  • RE: Migration Batch File
    ... Migration newsgroup mainly focuses Windows Server side migration issues. ... I'd like to suggest you post script related questions to our MSDN queue. ... What I want to achieve is to create a batch file that will prepare a PC ... So the end result would be a backup of the user settings so a domain ...
    (microsoft.public.windows.server.migration)
  • Re: Script to stop a SQL service
    ... Would the syntax be the same if I ran the command line script from within a ... I'm planning on running this batch file from within the BackUp Exec ... > You can also use SQL-DMO to stop/start a SQL Server instance. ... >> Is there a script that I can run to stop a particular SQL server service ...
    (comp.databases.ms-sqlserver)
  • Re: backing up SQL server
    ... Please go thu the script will take the UNC path as the parameter and will ... Backup Master, MSDB and all the User databases to the remote machine. ... can I reinstall and configure SQL server and then restore the ...
    (microsoft.public.sqlserver.server)