Re: Script to stop a SQL service
- From: "Paul O. Morris" <pomorris@xxxxxxxxxxx>
- Date: Tue, 5 Jul 2005 22:37:25 -0400
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.
>>
>>
>
>
.
- Follow-Ups:
- Re: Script to stop a SQL service
- From: Dan Guzman
- Re: Script to stop a SQL service
- References:
- Script to stop a SQL service
- From: Paul O. Morris
- Re: Script to stop a SQL service
- From: Dan Guzman
- Script to stop a SQL service
- Prev by Date: Re: Service fails to start
- Next by Date: User defined data type used in stored procedure parameters
- Previous by thread: Re: Script to stop a SQL service
- Next by thread: Re: Script to stop a SQL service
- Index(es):
Relevant Pages
|