Installing Northwind on SqlExpress

When performing a default install of Visual Studio 2005 an instance of Sql Server Express edition is installed. Unfortunately there are no sample databases included with Sql Express. (

I’ve had more than a few people ask how to get the Northwind sample database loaded into Sql Express so here are some step-by-step directions for getting Northwind up and running so you can start trying out all the great new data features in VS.

1) Navigate to the following URL and lick the Download button –

2) Complete the download and install process. This places the necessary files for Northwind (and Pubs) into the “c:\Sql Server 2000 Sample Databases” folder.

3) Open a command window. (Go to Start, Run, type Command and click OK)

4) Change the directory to the sample databases (type:  cd c:\SQL Server Sample Databases)

5) Type or paste the following into the command window replacing computerName with the actual name of your computer:

   osql -E -S computerName/SqlExpress -i instnwnd.sql

6) now go to VS and create a data connection using the computerName\sqlexpress as the Server name in the Add Connection dialog. The Northwind database should now be available.


-Steve Stein





Comments (23)

  1. Euan Garden says:

    You should really be using SQLCMD not osql.

  2. Bill Burrows [MVP] says:

    Hi Steve,

    Thanks for the information. May I suggest that this information be placed somewhere fairly obvious on the SQL Express home site. My guess is many people downloading SQL Express will want a database to play with.


  3. Rob Windsor says:

    You use the wrong slash in step 5:

    computerName/SqlExpress should be computerNameSqlExpress

  4. Ka says:

    osql -E -S computerName/SqlExpress -i instnwnd.sql

    should be

    osql -E -S computerNameSqlExpress -i instnwnd.sql

  5. enoreth says:

    thanks i installed successfully the northwind

    but the problem is it was installed under the databasename "master". Any suggestions?

  6. Trevor Carnahan says:

    I appreciate you putting this up. It was the first hit in my "how install northwind sqlexpress" google search, and it was exactly what I was looking for. Thanks again.

  7. Thang says:

    Using SQL Server Management Studio, you can use the Attach… function.

    In the SQL Mgt Studio:

    – Right click on Databases node, select Attach … – a Attach DBs dialog popups.

    – Click on the Add button on the dialog

    – Navigate to the location where you extract the database (northwind or pubs) and select the *.MDF file ( you can add more than one DB)

    – Click OK to complete it.

    You should see the new DB in the list under Databases node.

  8. Edgardo says:



  9. dave says:

    step 1 says to lick the download button:) but everything else works, thanks

  10. DeveloperDan says:

    Everything else works?  Nothing works for me after I lick the download button.  I hate computers!

  11. LFN says:

    Simply thank you.

  12. Mick says:

    Thanks for the post very useful, now get my express up and running

  13. Thanks a lot, this saved a lot of my time. I had a an important demo with one of my clients. Thanks again.

  14. DB says:

    osql didn’t work here, but

    sqlcmd -E -S computerNameSqlExpress -i instnwnd.sql

    did the job.

  15. Maybe this is just too obvious, but why not just provide the SQL Express version of the Northwind file directly intead ?

  16. Heres a post by Steve Stein that gives you a 5 step instruction guide to install Northwind db on SQLExpress….

  17. NewSQLProgrammer says:

    Excellent Steve!!!!!!!


  18. bill says:

    need it for the sql server 2005