SQL SERVER – 2005 NorthWind Database or AdventureWorks Database – Samples Databases – Part 2

I have mentioned the history of NorthWind, Pubs and AdventureWorks in my previous post SQL SERVER – 2005 NorthWind Database or AdventureWorks Database – Samples Databases. I have been receiving very frequent request for NorthWind Database for SQL Server 2005 and installation method.

Follow the steps carefully and it will install Northwind and Pubs database in SQL Server without any issue. I have tested all the three methods on my home computer and attached the screen shots as well.

Common Step for all the 3 methods

First, go to Microsoft Download Center and download SQL2000SampleDb.msi.
Run SQL2000SampleDb.msi it will create “C:\SQL Server 2000 Sample Databases” folder.
Now follow any of the following three methods to install this database. I have listed methods in order of my preference.

Method 1: Running SQLCMD
Navigate to this folder using command prompt. Start >> Run >> C:\SQL Server 2000 Sample Databases.
If you have installed SQL Server as named instance run following command.

c:\>sqlcmd -S .\InstanceName -i instpubs.sql
c:\>sqlcmd -S .\InstanceName -i instnwnd.sql

If you have installed SQL Server as default instance run following command.

c:\>sqlcmd -i instpubs.sql
c:\>sqlcmd -i instnwnd.sql

Verify that NorthWind and Pubs database are installed correctly.
Method 2: Running SQL Script
Open SQL Server Management Studio. Go to File >> Open >> Navigate to “C:\SQL Server 2000 Sample Databases\instpubs.sql” and “C:\SQL Server 2000 Sample Databases\instnwnd.sql” and run those SQL files in order. This will install the database.

Method3: Attaching the Database
Move Northwind and Pubs database files (MDF and LDF files) to your default database file location (usually – C:\Program Files\Microsoft SQL Server\MSSQL\Data).
Open SQL Server Management Studio. Expand the database node >> Right click on Databases >> Click on Attach >> Select NorthWind Database. It will automatically find MDF and LDF file. Click OK.

Repeat the process for Pubs and verify that databases are installed correctly.

Reference: Pinal Dave (https://blog.sqlauthority.com), Read-Me file in the installation folder, BOL

SQL Download, SQL Sample Database, SQL Scripts, SQL Server
Previous Post
SQL SERVER – Easy Sequence of SELECT FROM JOIN WHERE GROUP BY HAVING ORDER BY
Next Post
SQL SERVER – sp_HelpText for sp_HelpText – Puzzle

Related Posts

191 Comments. Leave new

  • Thanks a lot mate!! You are a star…

    Reply
  • Really nice ..Thanks sir

    Reply
  • I am getting the SQL native client like few others in this thread. I am trying to attach to SQL Express 2008 in Windows 7 Enterprise machine.

    HResult 0x2, Level 16, State 1
    Named Pipes Provider: Could not open a connection to SQL Server [2].
    Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
    shing a connection to the server. When connecting to SQL Server 2005, this failu
    re may be caused by the fact that under the default settings SQL Server does not
    allow remote connections..
    Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

    Reply
  • All,

    Those who are using SQLExpress and experiencing below error while attaching NORTHWIND database if using to connect to ASP.NET can use the identity impersonation along with user name and password (as interim solution)

    HResult 0xFFFFFFFF, Level 16, State 1
    SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
    Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this ….

    Reply
  • Thanks a lot!

    Reply
  • Thank you very much, I love it when things work, without a hitch, first time around.

    Reply
  • Hi Pinal,

    It’s very nice. i have installed it but through cmd prompt i get some error . i don’t have C Drive in this case what i do? please reply me …………..

    I love all your article ..

    Reply
  • Very good!!! Thanks!

    Reply
  • Anish Kumar
    July 7, 2011 2:45 pm

    Good Work Pinal..
    Cheers,
    Anish

    Reply
  • Hi….I installed SQL with dummy database..

    Reply
  • thanks for you help..

    Reply
  • I want database for pracrice

    Reply
  • I am trying option 2.
    Have run .msi and everything seems to be installed as outlined above.
    However, when I open instnwnd.sql (it opens a new query window) and then press F5 to run it prompts me to connect to a database engine and I am stuck.

    What do I type in the Server Name?

    Thanks

    Reply
  • hi Pinal,

    I could download .mdf and .ldf files of Northwind and Pubs databases and easily attach them as well in my SSMS but when I try to extract data fom these two databases ,I’am getting the error “Invalid object name ‘Northwind’. ” ..,,,Could you please help me with this problem..Thanks in advance

    Thanks,
    Amruta

    Reply
  • Very useful and understandable information. Great work sir.

    Reply
  • shivanshu ojha
    January 21, 2012 1:49 pm

    i install sql server 2005,but it’s show only system data base(master,model,msdb,temdb).I want to work in AdvetureWorks data base but it’s not show in data base ,what can i do???????????

    Reply
  • Thanks Dave, It works for me.

    Reply
  • Thanks Pinal.
    This was really helpful and was written in very simple way.

    Reply
  • great work. Thanks Pinal

    Reply
  • Thanks Pinal. I tried to install Northwind db to my SQL Express 2008. I tried method 1 and 3 and it successfully did. I did some work using visual C# 2010 express and it could connect to the DB. But the problem is that when I restart the machine and go back to the SQL Management console, NWind doesn’t connect. When I go to C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA folder, alongwith Northwind mdf & ldf files, I see a new file NORTHWND_log.LDF.
    Can you offer any clue as to why is this happening ?

    Reply

Leave a Reply

Menu
Exit mobile version