Originally, I created a database and then restored the backup file to my new empty database:
Right click on Databases > Restore Database > General : Device: [the path of back up file] → OK
This was wrong. I shouldn't have first created the database.
Now, instead, I do this:
Right click on Databases > Restore Database > General : Device: [the path of back up file] → OK
Another cause of this issue is when the Take tail-log backup before restore
"Options" setting is enabled.
On the "Options" tab, Disable/uncheck Take tail-log backup before restore
before restoring to a database that doesn't yet exist.
Please see below image and apply changes in SqlServer :
first right click on Database --> Task --> Restore --> Select Backup File --> Finally Apply Change in Options Tab.
Hope this can help you.
In our case it was due to the Recovery Model on the primary database having been changed after we did the backup in preparation for setting up log shipping.
Ensuring the Recovery Model was set to Full Recovery before doing the backup and setting up log shipping resolved it for us.
You can use following SQL to restore if you've already created database
RESTORE DATABASE [YourDB]
FROM DISK = 'C:\YourDB.bak'
WITH MOVE 'YourDB' TO 'C:\YourDB.mdf',
MOVE 'YourDB_Log' TO 'C:\YourDB.ldf', REPLACE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With