How to Backup and restore sql server database

Introduction: In previous articles i explained How to create Sql server database script and Create database from that script. and How to take Sql server database backup and How to take automatic backup of Sql server Database and 20 main differences between Stored procedures and Functions in Sql Server and Return data through Output Parameter in stored procedure and Retrieve specific range of rows from SQL Server database table.
In this article i will explain how to create Backup file of Sql server database and How to restore the database from Backup file. 

Implementation: Just follow the steps mentioned below:

Step 1: Right click on the database ->Task -> Backup… as shown in figure below:

Backup and restore sql server database example

Step 2: A window will open as shown in figure below. Set destination where you want to save your backup
file. Remove the already set default path and add your own path if you want to save the backup file in your preferred location other than the default path e.g. we have set it to D:\BACKUP\NorthwindBackup.bak. Note: while saving the file always add extension (.bak) with the file name e.g. NorthwindBackup.bak. Click Ok button.

Backup and restore sql server database example

Step 3: A window will appear showing the Backup successful message as shown in figure and congrats you have taken the backup of your database successfully.

Backup and restore sql server database example


How to Restore Sql server Database from Backup file

Now in order to restore the database from backup file follow the steps mentioned below:

Step 1: In the Object explorer window of the Sql server, Right click on the Databases ->Restore Database..  as shown in  figure below:

Backup and restore sql server database example

Step 2: A window will appear as shown in fig below:

Backup and restore sql server database example

Step 3: In the Destination for restore option Write the name of the database name e.g. Northwind in the To database field as shown in the figure below. And also In the Source for restore option select the option From device and click on the but ton as shown in figure below:


Step 4: A window will appear to specify Backup media as shown in figure below. Click on Add button

Backup and restore sql server database example

Step 5: Select the location of the Backup file from your system e.g. in our case D:\BACKUP\NorthwindBackup.bak.

Backup and restore sql server database example

Step 6: A window will appear and tick the Restore check box as shown in figure below:

Backup and restore sql server database example

Step 7: A window will appear showing the restoration successful message as shown in figure below:

Backup and restore sql server database example

Now over to you:
"If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google+, Twitter, Linked in and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox . Stay tuned and stay connected for more technical updates."
Previous
Next Post »

If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily..