还原数据库备份文件,版本不一致失败情况,选择master执行下面代码可以解决
RESTORE DATABASE newDataBase
FROM DISK = 'F:\old.bak' --bak文件路径
with replace,
MOVE 'old' TO 'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\newDataBase.mdf', --mdf文件路径
MOVE 'old_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\newDataBase.ldf' --ldf文件路径