Introduction
Northwind database is a sample DB, which is used in numerous tutorials, and which helps students to learn about databases and other programming subjects. Some of the subjects that students can learn through the Northwind database are given below.
- How the data is stored in a Relational database.
- Executing queries like SELECT, UPDATE, DELETE, ALTER, etc.
- How to use foreign keys and primary keys in the tables.
- Understanding the database structure and data normalization.
The students can even use Northwind database to do CRUD Operations from programming languages like PHP, jQuery, ASP, C++, C# and more.
Taking into account the usefulness of Northwind database, I decided to write a tutorial that helps the students to restore it in their SQL Server. After restoring it, they can use this database for learning purposes.
Note
This Restoring procedure is just a one minute job.
Requirements
You should have SQL Server installed in your computer. I am using SQL Server 2012 Edition here. The restoring database steps are same for other versions of SQL Server too.
Procedure to restore Northwind database in SQL Server are given below.
Just follow the restoring steps given below.
Step 1
The first step is to download Northwind database backup file (.bak) from CodePlex.
(I have also attached Nortwind Backup file in this tutorial).
This backup file contains a zip file (.zip). You need to extract the backup file (Northwind.bak) from the zip file.
You can also extract it to any other location of your PC. In this tutorial, I extracted it to the “E” drive. This makes it easy for me to remember the location.
Step 2
Open SQL Server Management Studio (SSMS). If you don’t have it - download if from the Microsoft Website.
SQL Server Management Studio (SSMS) helps in configuring, managing & developing SQL Server through rich sets of graphical tools..
Once you open SSMS, you will see a Window, which asks to connect to the Server. In this Window, put the settings given below.
- "Database Engine" for "Server type".
- "localhost” for “Server name".
- "Windows Authentication" for "Authentication".
Now, click Connect button.
SSMS will connect and open Object Explorer.
Step 3
Object Explorer shows the nodes like databases, security, Server objects, replication etc. Clicking the Plus sign at the front of these nodes will open them.
Right click the Databases node and select Restore Database option.
The Restore Database Window opens up. In this Window, for the “Source” option, select “Device” and then click the “...” button, which is next to it.
The “Select backup devices” Window will open now. Click Add button.
The “Locate Backup File” Window opens up, where you have to go to the folder, where the “Northwind.bak” file was extract and select it.
I extracted it to “E” drive, so I moved to E drive, where I easily located the backup file.
Now, click OK button to close the Locate Backup File Window.
You will see the Select backup devices Window now contains the Northwind.bak file.
Click OK button here too. This will close it and you will reach the Restore Database Window. Now, Restore Database Window contains the Northwind.bak and is ready to restore it.
Finally click OK button.
The restoration process will start and after few seconds, you will get the success message, which says “Database ‘NORTHWND” restored successfully.”
Northwind database is ready now
Northwind database is now available in your SQL Server for learning and doing programming works.
To see Northwind database in your SQL Server, click the “Refresh” button, followed by clicking the + sign in front of the databases node.
Not only the backup of Northwind database -- if you have a backup file of any other database, then you can use this tutorial to restore it in your SQL Server. The steps are the same.
Conclusion
This concludes this tutorial and it’s time to learn new database concepts. Have fun.