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

SQL SERVER - 2005 NorthWind Database or AdventureWorks Database - Samples Databases - Part 2 sqlservernw1

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

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

SQL SERVER - 2005 NorthWind Database or AdventureWorks Database - Samples Databases - Part 2 sqlservernw2

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.

SQL SERVER - 2005 NorthWind Database or AdventureWorks Database - Samples Databases - Part 2 sqlservernw3

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.

SQL SERVER - 2005 NorthWind Database or AdventureWorks Database - Samples Databases - Part 2 sqlservernw4

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

  • thank a lot .

    this is very helpful.

    Reply
  • Hi Dave,

    I need help a topic that is soo boring for me because i dont understand.
    Today i searched different resources on the internet to find using of full text search property by SQL Server 2008 easily, but i did not.
    Actually i reached some information but it is not enough for my understanding.
    What am i doing to use this property correctly?

    Where am i using it?

    Could you please give an advice about it:)

    Are there any websites that include understanding information and samples about it on the internet …

    Thanks for your interest.

    Ayşegül.

    Reply
  • brilliant explanation, it made my life a lot easier.

    Reply
  • I want to connect the adventure database to sql server management studio 2005

    can i know how ………..?

    Reply
  • Thank you Mr.

    Reply
  • Hi Pinal,

    Can I restore a SQLServer 2000 DB into SQLServer 2008?
    I want to restore the Cognos 8 SQLServer samples which are meant for 2000 into 2008.

    If yes please help.

    Thanks in advacne,
    Sunil.

    Reply
  • Thank You ,with this information i installed Northwind and pub database in a minit

    Reply
  • I made a mistake by not seeing this site first. Thanks a lot. You made it so easy :)

    Reply
  • TITLE: Microsoft SQL Server Management Studio
    ——————————

    Attach database failed for Server ‘SANAAELHASHMY’. (Microsoft.SqlServer.Smo)

    For help, click:

    ——————————
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ——————————

    Unable to open the physical file “C:SQL Server 2000 Sample Databasesnorthwnd.mdf”. Operating system error 5: “5(failed to retrieve text for this error. Reason: 15105)”. (Microsoft SQL Server, Error: 5120)

    For help, click:

    ——————————
    BUTTONS:

    OK
    ——————————

    Reply
  • nice explanation, ok back to tutorial again.

    Reply
  • Gr8 information i have installed both northwind and pubs database in a minute
    thanx a lot

    Reply
  • thanks its really helpful

    Reply
  • Hey, wanted to say thanks for the info. You have some easy steps to follow. TNX

    Reply
  • Sir,
    Can you please suggest me where to find other sample databases for Microsoft SQL Server 2008 other than AdventureWorks.

    Reply
  • Hey,
    Its really helpful
    1st method gives error Error Locating Server/Instance Specified [xFFFFFFFF].
    but from 2nd method its done.
    But m really keen to know about this error how can i solve it

    Reply
  • gr8 post worked for me to install Northwind database on Win XP Pro on SQL Server 2005 Express Edition

    Reply
  • Sivawut Srithammawut
    January 16, 2011 1:57 pm

    This is a very good tutorial.

    Thanks

    Reply
  • 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

Leave a Reply