How to use sqlcmd to create a database

后端 未结 5 1628
刺人心
刺人心 2020-12-31 05:31

I have a .sql script and I want to build a database from it. How to do it in sqlcmd? I know it\'s like:

CREATE DATABASE dbName
GO

But how t

5条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 06:20

    This is very simple. Just enter following command to run sqlcmd:
    sqlcmd -U sa -P password
    Then enter:

    CREATE DATABASE MYDB
    GO
    

    This will create the db. Then enter "quit" to exit.

提交回复
热议问题