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 you I have successfully Installed it,

    Peace

    Reply
  • Thank you!!! I was having no luck figuring out how to install Northwind until I found your site. MS should be installing these samples if they’re going to continue to refer to them in their tutorials (e.g. the VisualStudio 2008 web development “walkthrough” tutorials.)

    Boy am I glad I found your site! ;0)

    Reply
  • JJ is correct. One can no longer run the downloaded SQL2000SampleDb.msi . It just produces an error saying “This installation package could not be opened”

    Microsoft really knows how to screw things up!

    Reply
  • Hey, oceans of thanks!!!!! It worked…

    Reply
  • Thank you so much! it is very helpful and quick.

    Reply
  • i am getting this error while running command

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

    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 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.

    Please help .

    Reply
  • Hey its Really gud…..
    thanx a million….

    Reply
  • Many thanks. You made it easy.

    Reply
  • Thanks for the help!

    Reply
  • Thank You.

    It was nearly impossible to find out how to install the .mdf and .ldf file. I tried to select File–>open, but the programm said : “No edito avilable for Northwind.mdf” !!!!
    I also tried “new –> Database” but i cannot open an existing.
    Not so easy, because im speaking english not very well!

    Thank You!

    Reply
  • I install the SQL Server 2008 but the enterprise and Query Analizer are not on it that I create a database why?

    Reply
  • Thanks, it work for me. i use windows vista so i install sql 2005,with compatibility setting of windows xp service park 2..
    And it worked well.

    Reply
  • I need a sample in sql server quickly if somebody know about dowloading it please send to me

    Reply
  • k.anantharengan
    April 9, 2010 7:20 am

    very useful post.

    Reply
  • thank you very much for the great help

    Reply
  • I have adventurework database, but i couldn’t work it, pls send step to step work adventurework database

    Reply
  • thanks…i got help from this article…nice article and nice blog..

    Reply
  • Hy, my name is marko,
    when I trying to attach database on SQL Server 2008 i am getting this error while running command

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

    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 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.

    I have Windows Vista Ultimate X64 SP 2 Operation System

    Please help .

    Reply
  • Hi,

    I am not able to attach a MDF file to SQL Server 2005 developer’s edition in Windows Server 2003 system.

    But able to attach the same to SQl Server 2005 developer’s edition in Windows XP system.

    is there any caveats in attaching MDF files in SQl Server 2005 developer’s edition in different OS.

    I am using Management Studio and sa login in both cases to attach the files.

    Thanks in advance

    Reply
  • Hi,

    Thks… superb wrk…

    Reply

Leave a Reply