How to run .bat or script file in SQL server for creating database?

Create SQL Database by Running Script File (.bat File)

 

STEP 1

image Open Command Prompt. Go to Start -> Run -> cmd now Enter.

 

image
STEP 2

Run command cd\ on command prompt.

 

image

STEP 3

image Copy DATABASENAME.bat file folder path.

 

image

STEP 4

Type following command on command prompt and hit Enter.
cd "Folder path location"

 

image

STEP 5

Now type DATABASE.bat file name and Enter.

 

image

Type following command on command prompt:

Batch File Path >> Server Name >> Database Name

Hit Enter.

 

A new database into SQL Server will be created.

Home SysTools FAQs » SQL Server » How to Detach a Database in SQL Server
Loading