0

I try to restore my .bak file using ms SQL server .but i keep getting this error...

Restore failed for Server 'CST-BLACKSERVER'. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

The backup set holds a backup of a database other than the existing 'fitness' database. RESTORE DATABASE is terminating abnormally. (.Net SqlClient Data Provider)

migrated from stackoverflow.com Oct 20 '09 at 16:18

This question came from our site for professional and enthusiast programmers.

1

Try this:

  • Select the Backup to restore
  • Set the Option "Override existing Database (WITH REPLACE)
1

Check path is correct ,if you install MSSQL in C: drive then the path should be in Data folder

Row Data : C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\filename.mdf

Log : C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\filename_1.ldf.

E.g : i am using asd as my database name when restoring . Here is the way i did

alt text

0

Perhaps stating the obvious: did you select the option: "Overwrite the existing database"?

  • Just keep in mind that when you select the Overwrite the existing database option any data which is currently in the fitness database that isn't in the backup will be lost unless you have another backup which you can get the data from. – mrdenny Oct 20 '09 at 19:02
0

The error says that the backup file contains more than one backup, so you should be specifying which backup you want to restore using the "FILE = #" format. If you use SQL Management Studio to restore it will show you the different backups added to the BAK file and you would just check the box next to the one you want to restore. Do that and then select the option to script the command out to a new query window and you will see the proper syntax. If you only want to have one backup stored in the BAK file you need to change your backup command and add a "WITH INIT".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy