SQL Server service uses batch start/Stop Method (SC) _dos/bat

Source: Internet
Author: User
Tags mssqlserver
Then let some non-Windows necessary services such as SQL Server boot up, and then use the batch process to start up:

First, set the SQL Server-related service startup type in the Control Panel-> Administration Tools-> Service to manual (services at the beginning of SQL Server), and then create a new text document that changes the suffix name to "bat." The batch command is added below:

1. Start SQL Server.bat
Copy Code code as follows:

@echo. Service startup ...
@echo off
@sc start MSSQLServer
@sc Start SQLServerAgent
@sc Start MSSQLServerOLAPService
@sc Start Msftesql
@sc Start Msdtsserver
@sc Start Sqlwriter
@echo off
@echo, boot up!
@pause

2. Stop SQL Server.bat
Copy Code code as follows:

@echo. Service stop ...
@echo off
@sc Stop SQLServerAgent
@sc Stop MSSQLServerOLAPService
@sc Stop Msftesql
@sc Stop Msdtsserver
@sc Stop Sqlwriter
@sc Stop MSSQLServer
@echo off
@echo, Stop!
@pause

The SC (server Control) command can be viewed using the "sc-help" command, or it can be searched online. After the two batch files have been established, it is convenient to execute the batch file "start SQL Server.bat" when running SQL Server 2005, and then execute "stop SQL Server.bat" when exiting.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.