I'm trying to restore a backup from a 'dev' database to an existing copy 'test' database on a SQL Express box & I'm getting:
'DEV_Database_Test.mdf' cannot be overwritten. It is being used by database 'DEV_Database_Test'
&
File 'DEV_Data' cannot be restored to 'C:\MSSQL\DATA\DEV_Data_Test.mdf'. Use WITH MOVE to identify a valid location
for the file.
File 'DEV_Data_2' cannot be restored to 'C:\MSSQL\DATA\DEV_Data_Test_2.ndf'. Use WITH MOVE to identify a valid location
for the file.
File 'DEV_Data_Log' cannot be restored to 'C:\MSSQL\DATA\DEV_Data_Test_Log.ldf'. Use WITH MOVE to identify a valid
location for the file.
Even when I'm setting the database offline, with replace & using MOVE...
Here's my syntax:
USE [master]
ALTER DATABASE Dev_Database_Test
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
RESTORE DATABASE
Dev_Database_Test FROM DISK='C:\MSSQL ...
Go to the complete details ...