Start stop MSSQLServer service on DOS bat

Source: Internet
Author: User
Tags mssqlserver

650) this.width=650; "src=" http://183.61.143.148/group1/M00/02/5A/tz2PlFRCDj2SFaZdAAAvtrPCbUc507.jpg "/>

Many friends will meet me the same problem, because the machine loaded with SQL Server2005, causing the machine to slow down, there is no way to let SQL Server (MSSQLSERVER) service is not started by default. But every time you want to use SQL Server, you have to start it from the Control Panel-management tool-service, it is more troublesome, hehe.

so think of starting and shutting down SQL Server from under DOS (MSSQLSERVER) , execute it in the run, the command code is as follows:

start: net start mssqlserver

STOP: net stop mssqlserver

later thinking more convenient, wrote a bat command as follows, can be more convenient to start stopping SQL Server (MSSQLSERVER). Enter 1 to return the car, start the service, enter 2 return the car, close the service

@ECHO OFF

set/p var= operation [1: Start, 2: Stop]:

if%var%==1 goto start

if%var%==2 goto stop

: Start

net start MSSQLServer

Goto End

: Stop

net stop MSSQLServer

Goto End

: Stop

net stop MSSQLServer

Goto End

: End

the above is a personal summary of some of the content can refer to, want to learn more Database Tutorials knowledge can be landed on E mentor Network.


This article is from the "Add Language" blog, please make sure to keep this source http://yuguotianqing.blog.51cto.com/9292883/1565777

Start stop MSSQLServer service on DOS bat

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.