Last active
May 26, 2021 13:57
-
-
Save outrowender/bd0c2d7aed9dd1da70a7d7f1c7378598 to your computer and use it in GitHub Desktop.
Restore database from .bak file in sqlcmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlcmd -S localhost -U SA -P 'password' | |
RESTORE DATABASE [dbname] FROM DISK='db.bkp' | |
WITH MOVE 'db' TO '/var/opt/mssql/data/db.mdf', | |
MOVE 'db_Log' TO '/var/opt/mssql/data/db_Log.ldf', | |
REPLACE, | |
STATS=10 | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment