SQL Server Can mssql-cli run a sql script file?

os8fio9y  于 2023-05-21  发布在  其他
关注(0)|答案(1)|浏览(151)

I have a sql script called database_create.sql. On Windows, I can run this from sqlcmd as follows:

sqlcmd -U sa -P Password -S 192.168.nnn.mmm -i database_create.sql -o output.txt

I want to run the same script on Linux (Centos7). I have mssql-cli version 0.15.0 but cannot find out how to get it to run my sql script.

A thread on github ( https://github.com/dbcli/mssql-cli/issues/139 ) suggests it's not possible yet.

I can't believe Microsoft haven't duplicated the sqlcmd functionality in mssql-cli. Can anyone help me with this?

67up9zun

67up9zun1#

I installed mssql-tools which contains bcp and sqlcmd.

相关问题