Start/stop SQL Server service using batch processing

Source: Internet
Author: User
Tags mssqlserver

Personal PCs are generally used to speed up startup and minimize service startup. Especially as a developer, if the home computer is not configured high, the startup speed is obviously slow after the SQL Server is installed, so let some non-Windows Services such as SQL Server do not start up, and then use batch processing to start it when it is used:

First, set the SQL Server-related Service Startup Type in "Control Panel> Administrative Tools> Services" to manual (Services starting with SQL Server), and create a new text document, change the suffix to "Bat ". Add the batch processing command below:

1. Start SQL Server. bat

@ Echo. Start the service ......
@ Echo off
@ SC start MSSQLServer
@ SC start SQLServerAgent
@ SC start mssqlserverolapservice
@ SC start msftesql
@ SC start msdtsserver
@ SC start sqlwriter
@ Echo off
@ Echo. started!
@ Pause

2. Stop SQL Server. bat

@ Echo. The service is stopped ......
@ Echo off
@ SC stop SQLServerAgent
@ SC stop mssqlserverolapservice
@ SC stop msftesql
@ SC stop msdtsserver
@ SC stop sqlwriter
@ SC stop MSSQLServer
@ Echo off
@ Echo. Stopped!
@ Pause

The specific usage of the SC (Server Control) command can be viewed using the "SC-help" command, or you can search online. After these two batch files are created, when SQL Server 2005 is run, run "start SQL Server. bat "indicates the batch processing file. When you exit, execute" Stop SQL Server. bat ", very convenient.

 

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.