SqlServer2005还原数据库3154错误解决方法


问题描述:用Sql Server2008恢复数据库备份(使用sql server 2000 备份的)文件MyDatabase.BAK,报错如小:

The backup set holds a backup of a database other than the existing ’MyDatabase’ database.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3154)

解决办法:

1.新建一个同名数据库MyDatabase

2.执行下面的sql语句:
restore database MyDatabase from disk = ’C:MyDatabaseBackupMyDatabase.BAK’ 

with replace;

 

如果提示找不到路径C:MyDatabaseBackup,请手动建立此路径。


Whatever is worth doing is worth doing well.