I am using SQL Server 2008 R2, I have a backup file B:\backups\full_backup.bak
but I do not know what backups this file has or what files each back has. How can I write a query to restore a database from this backup file?
I have tried to restore database but it threw an error saying
Msg 3156, Level 16, State 4, Line 1
File 'Application_Primary' cannot be restored to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Application_Primary.mdf'. Use WITH MOVE to identify a valid location for the file.Msg 3156, Level 16, State 4, Line 1
File 'Application_FTS' cannot be restored to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Application_FTS.mdf'. Use WITH MOVE to identify a valid location for the file.Msg 3156, Level 16, State 4, Line 1
File 'Application_Log' cannot be restored to 'L:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Application_Log.ldf'. Use WITH MOVE to identify a valid location for the file.Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Code:
restore database Application_db
From disk = 'B:\backups\full_backup.bak'