Partilhar via


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. (https://lab.msdn.microsoft.com/express/sql/)

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 - https://www.microsoft.com/downloads/details.aspx?familyid=06616212-0356-46a0-8da2-eebc53a68034&displaylang=en

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

  • Anonymous
    November 02, 2005
    You should really be using SQLCMD not osql.

  • Anonymous
    November 02, 2005
    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.

    bill

  • Anonymous
    November 03, 2005

    You use the wrong slash in step 5:

    computerName/SqlExpress should be computerNameSqlExpress

  • Anonymous
    November 22, 2005
    osql -E -S computerName/SqlExpress -i instnwnd.sql

    should be

    osql -E -S computerNameSqlExpress -i instnwnd.sql

  • Anonymous
    January 10, 2006
    thanks i installed successfully the northwind
    but the problem is it was installed under the databasename "master". Any suggestions?

  • Anonymous
    January 16, 2006
    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.

  • Anonymous
    January 22, 2006
    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.

  • Anonymous
    January 26, 2006
    Excellent!

    Thanks

  • Anonymous
    March 01, 2006
    The comment has been removed

  • Anonymous
    March 20, 2006
    The comment has been removed

  • Anonymous
    May 19, 2006
    Simply thank you.

  • Anonymous
    May 23, 2006
    Thanks for the post very useful, now get my express up and running

  • Anonymous
    August 09, 2006
    Thanks a lot, this saved a lot of my time. I had a an important demo with one of my clients. Thanks again.

  • Anonymous
    August 16, 2006
    osql didn't work here, but
    sqlcmd -E -S computerNameSqlExpress -i instnwnd.sql
    did the job.

  • Anonymous
    August 29, 2006
    Maybe this is just too obvious, but why not just provide the SQL Express version of the Northwind file directly intead ?

  • Anonymous
    December 11, 2006
    Heres a post by Steve Stein that gives you a 5 step instruction guide to install Northwind db on SQLExpress....

  • Anonymous
    July 05, 2007
    Excellent Steve!!!!!!! Thanks

  • Anonymous
    August 03, 2007
    need it for the sql server 2005

  • Anonymous
    November 18, 2008
    PingBack from http://blog.ssh.tw/?p=1247

  • Anonymous
    February 24, 2009
    PingBack from http://www.dooz.se/blog/?p=270

  • Anonymous
    June 08, 2009
    PingBack from http://toenailfungusite.info/story.php?id=5226

  • Anonymous
    June 13, 2009
    PingBack from http://barstoolsite.info/story.php?id=6550