Home All Groups Group Topic Archive Search About

Stop & Start SQL Server for using scm



Author
16 Mar 2006 8:31 PM
qq
Hi, All,

I wrote a batch file including the following command to stop SQL server:
C:\Program Files\Microsoft SQL Server\80\Tools\binn\scm –Action 6 –service
mysqlserver

When I use manually to run the batch file in Command Prompt, it works fine.
But when I put the batch file in Scheduled Tasks to schedule to run the batch
file, when the SQL server has been stop, then the processing stuck, the
following commands in my batch file couldn’t run.

Does anyone know how to use SCM command to stop and start SQL server in
batch file for scheduling processing?

Thanks in advance,

--qq

Author
17 Mar 2006 3:25 AM
Sue Hoegemeier
I don't think you can do it using SCM due to the message
boxes. You can use: net stop mssqlserver
from the command line to stop SQL Server.

-Sue

On Thu, 16 Mar 2006 12:31:19 -0800, qq
<q*@discussions.microsoft.com> wrote:

Show quoteHide quote
>Hi, All,
>
>I wrote a batch file including the following command to stop SQL server:
>C:\Program Files\Microsoft SQL Server\80\Tools\binn\scm –Action 6 –service
>mysqlserver
>
>When I use manually to run the batch file in Command Prompt, it works fine.
>But when I put the batch file in Scheduled Tasks to schedule to run the batch
>file, when the SQL server has been stop, then the processing stuck, the
>following commands in my batch file couldn’t run.
>
>Does anyone know how to use SCM command to stop and start SQL server in
>batch file for scheduling processing?
>
>Thanks in advance,
>
>--qq
Are all your drivers up to date? click for free checkup

Author
17 Mar 2006 4:06 PM
qq
Hi, Sue,

Thank you for your help. When I run my batch file manually for using scm
command, I got a message boxes, said that stop SQL server successfully, then
I click OK, then the following commands in my batch file continued to run.
The message boxes are what you ware talking about, right? You mean that my
batch file stuck because of the message boxes, Right?

I will try to use net stop mssqlserver in my batch file to stop SQL Server.

--qq


Show quoteHide quote
"Sue Hoegemeier" wrote:

> I don't think you can do it using SCM due to the message
> boxes. You can use: net stop mssqlserver
> from the command line to stop SQL Server.
>
> -Sue
>
> On Thu, 16 Mar 2006 12:31:19 -0800, qq
> <q*@discussions.microsoft.com> wrote:
>
> >Hi, All,
> >
> >I wrote a batch file including the following command to stop SQL server:
> >C:\Program Files\Microsoft SQL Server\80\Tools\binn\scm –Action 6 –service
> >mysqlserver
> >
> >When I use manually to run the batch file in Command Prompt, it works fine.
> >But when I put the batch file in Scheduled Tasks to schedule to run the batch
> >file, when the SQL server has been stop, then the processing stuck, the
> >following commands in my batch file couldn’t run.
> >
> >Does anyone know how to use SCM command to stop and start SQL server in
> >batch file for scheduling processing?
> >
> >Thanks in advance,
> >
> >--qq
>
>
Author
17 Mar 2006 9:03 PM
qq
Hi, Sue,

I have a question for you.

If I use net stop mssqlserver in my batch file to stop SQL server. Is there
any problem on SQL Server? Because I am thinking that there may have some
transaction processing when use net stop command to stop SQL Server service.

Is SCM command same as net command? Is there any different?

Is there any option I can use SCM command to skip that message boxes?

Thanks a lot.

--qq


Show quoteHide quote
"Sue Hoegemeier" wrote:

> I don't think you can do it using SCM due to the message
> boxes. You can use: net stop mssqlserver
> from the command line to stop SQL Server.
>
> -Sue
>
> On Thu, 16 Mar 2006 12:31:19 -0800, qq
> <q*@discussions.microsoft.com> wrote:
>
> >Hi, All,
> >
> >I wrote a batch file including the following command to stop SQL server:
> >C:\Program Files\Microsoft SQL Server\80\Tools\binn\scm –Action 6 –service
> >mysqlserver
> >
> >When I use manually to run the batch file in Command Prompt, it works fine.
> >But when I put the batch file in Scheduled Tasks to schedule to run the batch
> >file, when the SQL server has been stop, then the processing stuck, the
> >following commands in my batch file couldn’t run.
> >
> >Does anyone know how to use SCM command to stop and start SQL server in
> >batch file for scheduling processing?
> >
> >Thanks in advance,
> >
> >--qq
>
>
Author
18 Mar 2006 3:42 PM
Sue Hoegemeier
In regards to the first question, yes...the prompts asking
if you want to stop SQL Server is what I'm referring to.
There is no way to bypass the messages. It's fine to use net
stop to stop the service. You can find more information in
books online under the topic: Stopping SQL Server

-Sue

On Fri, 17 Mar 2006 13:03:27 -0800, qq
<q*@discussions.microsoft.com> wrote:

Show quoteHide quote
>Hi, Sue,
>
>I have a question for you.
>
>If I use net stop mssqlserver in my batch file to stop SQL server. Is there
>any problem on SQL Server? Because I am thinking that there may have some
>transaction processing when use net stop command to stop SQL Server service.
>
>Is SCM command same as net command? Is there any different?
>
>Is there any option I can use SCM command to skip that message boxes?
>
>Thanks a lot.
>
>--qq
>
>
>"Sue Hoegemeier" wrote:
>
>> I don't think you can do it using SCM due to the message
>> boxes. You can use: net stop mssqlserver
>> from the command line to stop SQL Server.
>>
>> -Sue
>>
>> On Thu, 16 Mar 2006 12:31:19 -0800, qq
>> <q*@discussions.microsoft.com> wrote:
>>
>> >Hi, All,
>> >
>> >I wrote a batch file including the following command to stop SQL server:
>> >C:\Program Files\Microsoft SQL Server\80\Tools\binn\scm –Action 6 –service
>> >mysqlserver
>> >
>> >When I use manually to run the batch file in Command Prompt, it works fine.
>> >But when I put the batch file in Scheduled Tasks to schedule to run the batch
>> >file, when the SQL server has been stop, then the processing stuck, the
>> >following commands in my batch file couldn’t run.
>> >
>> >Does anyone know how to use SCM command to stop and start SQL server in
>> >batch file for scheduling processing?
>> >
>> >Thanks in advance,
>> >
>> >--qq
>>
>>

Bookmark and Share