SQL Server Backup & Restore
USE [master];
GO
CREATE DATABASE test;
GO
CREATE DATABASE test2;
GO
BACKUP DATABASE test TO DISK = 'c:\temp\test.bak' WITH INIT, COMPRESSION;
GO
RESTORE DATABASE test2
FROM DISK = 'c:\temp\test.bak'
WITH REPLACE,
MOVE 'test' TO 'c:\temp\test2.mdf',
MOVE 'test_log' TO 'c:\temp\test2.ldf';
参考: http://dba.stackexchange.com/questions/44967/error-3154-while-restoring-a-backup-using-with-replace