How to Install the Northwind Database to SQL Server 2012

This guide will show how to install Northwind database in a few easy steps.

Northwind is the name of the sample database for SQL Server 2000, that later got replaced with the AdventureWorks sample database in SQL Server 2005. However, it is still used in many Microsoft SQL Server Database Development Training Kits so may still be relevant for users trying to learn SQL essentials. It is also a much smaller dtabase than AdventuresWorks, and much easier to learn SQL Server with.

The problem is that the original database file is not compatible with the newest version of SQL Server and causes difficulty for new users. Here is the “fixed” database file and a guide to install it.

  1. You can download the Northwinddatabase from the BIT275 Lecture 11 website (zipped) and I would recommend you extract and copy it to your SQL Server DATA folder located in “C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA”.

  2. Open the Start Orb, then All Programs, then navigate to Microsoft SQL Server 2012 and selectSQL Server Management Studio.

  3. Connect to your SQL Server instance.

  4. Right-click the “Databases” folder and click “Attach”.

  5. Click “Add…” in the “Databases to attach:” box and find NORTHWIND.MDF in your folder. Make sure to click on the file and check that the “Database Data File Location:” is accurate. Click OK.

  6. Notice that it includes a “NORTHWIND_log.ldf” which actually doesn’t exist. So we want to click on that and remove it. Don’t worry! A new log file will automatically get created in the right location once you have attached the database. Also, verify that “NORTHWIND.MDF” has the right “Current File Path”. Click OK.

  7. Check the “Databases” folder in SQL Server Management Studio for the “northwind” database.

  8. Click on the “northwind” database to expand

  9. Click on the Tables folder to expand

  10. Right-click on dbo.Employees and select Select Top 1000 Rows

  11. Right-click on dbo.Employees and select Edit Top 200 Rows
  1. Right-click on dbo.Employees and select Design

  2. Select New Query from menu bar, enter the following, then the Execute button

SELECT FirstName, LastName

FROM Employees

WHERE LastName LIKE'%ll%';

  1. TheResultsshould look like the following: