Use MSSQLServer service on DOS bat

Source: Internet
Author: User
Tags mssqlserver

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 (MSSQLSERVER) from under DOS, run it inside and execute it, 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 contents can be consulted, want to learn more about the database tutorial knowledge can be landed e Mentor network.

Use 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.