Code:
RESTORE DATABASE [MYDBNAME] FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MYDBNAME_db_200807212005.BAK' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10
GO
This is on a test server. I had copied this backup from the live server. The live server has the database in this folder:
d:\MSSQL\data\MYDBNAME.mdf
My test server has it in this folder:
C:\Program Files\Microsoft SQL Server\MSSQL\Data\MYDBNAME.MDF
I am getting the following errors both using the Restore function as well as using SQL.
Server: Msg 5105, Level 16, State 2, Line 1
Device activation error. The physical file name 'd:\MSSQL\data\MYDBNAME.mdf' may be incorrect.
Server: Msg 3156, Level 16, State 1, Line 1
File 'MYDBNAME.mdf' cannot be restored to 'd:\MSSQL\data\MYDBNAME.mdf'. Use WITH MOVE to identify a valid location for the file.
Server: Msg 5105, Level 16, State 1, Line 1
Device activation error. The physical file name 'd:\MSSQL\data\MYDBNAME.ldf' may be incorrect.
Server: Msg 3156, Level 16, State 1, Line 1
File 'MYDBNAME.ldf' cannot be restored to 'd:\MSSQL\data\MYDBNAME.ldf'. Use WITH MOVE to identify a valid location for the file.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
What do I need to do? This is kind of a rush. Thanks.