执行以下SQL代码:
RESTORE DATABASE WF
FROM DISK = ‘D:\ccflow\DataBase\WF_SQL2005.bak’
with replace,
MOVE ‘WF’ TO ‘C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\WF.mdf’,
MOVE ‘WF_log’ TO ‘C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\WF_log.ldf’
注释:WF是你需要还原的数据库名称,WF_SQL2005..bak是你需要还原的备份文件。
OK,搞定。
、、、、、、、、、、、、、、、、、
重点
restore database CarManager from disk = 'D:\20120307.BAK'with replace;
如果还原失败:Exclusive access could not be obtained because the database is in use
解决办法:Alter Database DBName
SET SINGLE_USER With ROLLBACK IMMEDIATE