This guide will show how to install northwind database in only 3 easy steps.
Having trouble attaching northwind database to your SQL Server 2012? Well you are not alone! 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 e.g. Microsoft SQL Server 2008 Database Development Training Kit so may still be relevant for users trying to learn SQL essentials.
The problem is that the original database file is not compatible with the newest version of SQL Server and causes difficulty for new users. We don’t believe the first lesson of SQL training should be jumping through hoops to get the sample data working, so here is the “fixed” database file and a guide to install it.
You can download the database here (zipped) and I would recommend you extract it to your SQL Server DATA folder as e.g.: “C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA”.
Open SQL Server Management Studio and connect to your instance. Right-click the “Databases” folder and click “Attach”.
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.
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 datbase. Also, verify that “NORTHWIND.MDF” has the right “Current File Path”. Click OK and check the “Databases” folder in SQL Server Management Studio for the “northwind” database.
That’s it! You should now have full access to the Northwind Sample Database in a SQL Server 2012 environment.