linux mssql sql server 指令

刪除
sqlcmd -S localhost -U sa -P 2Gaujrgr -Q "DROP DATABASE Mplus"

一條指令處理
sqlcmd -S localhost -U sa -P 2Gaujrgr -Q "RESTORE DATABASE Mplus FROM DISK = '/var/opt/mssql/backup/20201223Mplus.bak' WITH MOVE 'Mplus' TO '/var/opt/ms
sql/data/Mplus.mdf', MOVE 'Mplus_log' TO '/var/opt/mssql/data/Mplus_0.ldf'"

RESTORE DATABASE Mplus
FROM DISK = '/var/opt/mssql/backup/20201223Mplus.bak'
WITH MOVE 'Mplus' TO '/var/opt/mssql/data/Mplus.mdf',
MOVE 'Mplus_log' TO '/var/opt/mssql/data/Mplus_0.ldf'
GO