In the Microsoft SQL Server Management Studio there are three options on the Option "page" when you restore a database.
Option 1 (the default): Leave the database ready to use by rolling back uncommitted transactions. Additional transaction logs cannot be restored.(RESTORE WITH RECOVERY)
Option 2: Leave the database non-operational, and do not roll back uncommitted transactions. Additional transaction logs can be restored.(RESTORE WITH NORECOVERY)
To properly restore a database that is backup up using full recovery mode with full and differential backups, here are the steps you need to follow to not get the above error.
Restore Full backup
- Open the Restore Database window in Microsoft SQL Server Management Studio
- Ensure the To database field is filled in with the name you want.
- Choose From device as the Source for restore.
- Choose the full backup file you want to restore. In most cases this is the most recent full backup file.
- Click the Options page on the left navigation.
- Choose Leave the database non-operational, and do not roll back uncommitted transactions. Additional transaction logs can be restored.(RESTORE WITH NORECOVERY). This is the most important step!!!
- Open the Restore Database window in Microsoft SQL Server Management Studio
- Ensure the To database field is filled in with the name you want. The same that you specified in step 2 for the Restore Full backup
- Choose From device as the Source for restore.
- Choose the differential backup file you want to restore. In most cases this is the most recent differential backup file.
- Click the Options page on the left navigation.
- Choose the default: Leave the database ready to use by rolling back uncommitted transactions. Additional transaction logs cannot be restored.(RESTORE WITH RECOVERY) Make sure to choose this if you want to use your database after the restore.