Turn on or off the bat file for SQL Server services

Source: Internet
Author: User
Tags goto mssqlserver

The interface is as follows:

Because the computer's SQL Server service does not start on its own, and sometimes needs to shut down the SQL Server service, you find a tutorial on the Internet.

The source code is as follows:

@echo off
choice/t 3/c yn/d y/m Please enter y to start SQL Server service, n stop SQL Server service, or automatically select start after 3 seconds

if errorlevel 1 goto start
if errorlevel 2 goto stop

: Start
NET start MSSQLServer
Goto END

: Stop
net stop MSSQLServer
Goto END

: End
echo Thanks for using, three seconds will automatically turn off
Ping-n 1 127.1>nul
Echo 3 ...

Ping-n 2 127.1>nul
Echo 2 ...

Ping-n 3 127.1>nul
Echo 1 ...

Turn on or off the bat file for SQL Server services

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.