Posts

Showing posts from March, 2014

How to run SQL Script from a particular folder using Command Prompt

To run SQL Script stored in a particular folder using Command Prompt: REM - Run SQL Script to prepare the database environment ECHO Preparing Databases... SQLCMD -E -i C:\ETL_Solution\SetupFiles\Setup.sql

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