|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Stop & Start SQL Server for using scm
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, 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, > 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. 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, > > > > 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. 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, > > > > 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. > > > >"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, >> > >> >>
Other interesting topics
expectations for SUM query on 50+ million rows
Internal SQL Server error Move 2000 to 2005 Page coruption Management Studio Question.... what kind of index to use in this situation. Stored procedures in master database SQL Server 200/2005 Add User to Log-Shipped Database how to crash/corrupt a Microsoft SQL 2005 Server? deadlocked on lock |
|||||||||||||||||||||||