SQL Server 2012: installing Northwind Database

Northwind Database was commonly referenced in some Microsoft Press books and examples on the internet on SQL Server. Now it has been superseded by AdventureWorks database. Still, you can find many examples that refer to Northwind structures in older books and articles.

If you already have SQL Server 2012 installed (e.g. small LocalDB edition, great for education/development), because of the compatibility issues you can’t just attach the database in SQL Server Management Studio, as it has been created for use with SQL Server 2000. The good news is that inside the original package there is a instnwnd.sql text file that can be used nearly without modifications to create database and fill it with data. Here are the steps that let me install the database in SQL Server 2012 (LocalDB edition):

  1. Download Northwind database package from Microsoft sites
  2. In the instnwnd.sql file, find the lines:
    and delete them (or comment out). They are now deprecated (in SQL Server 2012) and break the script*.
  3. Execute the instnwnd.sql script, eg. from SQL Server Management Studio (which you have probably installed already).

Similar approach allows us to install database from the package. Good luck!

Tags: