How to Start and Stop SQL Server using Commend Prompt or Batch file


To restart SQL Server, you can use below commands

How to Start and Stop SQL Server using Commend Prompt or Batch file

Batch file should be as below:

@Echo Off

REM - Restart SQL Server Service to force closure of any open connections

NET STOP SQLSERVERAGENT
NET STOP MSSQLSERVER
NET START MSSQLSERVER
NET START SQLSERVERAGENT



Comments

Popular posts from this blog

Calculating Age of the person in T-SQL

How to Troubleshoot Subscription issue in Reporting Services

MDX Queries - Current Day - Month and Year