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

  • my name is urbain, i am learning sql so please i need your help, can you please send me adventure works database download to my email which is so i can download it to my computer and i can practice and please i need your help

    Reply
  • Gregory Howard
    July 31, 2008 10:49 am

    Excellent Article. I love it.

    Reply
  • Great. Thanks a lot. It was so quick to install the both databases.

    Reply
  • gr88 job man.really helped me a lot

    Reply
  • Hi:

    I download SQL2000SampleDb.msi (288k).
    But, I can’t run it.
    It used ‘Windows installer’ to run that file and give me the following message.

    “This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows installer package.”

    Can you tell me how to fix it? Thanks.

    Regards,
    JJ

    Reply
  • kemal can kara
    August 19, 2008 11:17 pm

    vaoov your are the best, five problems i had and you solve all of them easily. Loves from Turkey

    Reply
  • Thanks a lot

    Reply
  • hi i was trying to attach adventure works database but it gave me error stating failed to retrieve data for this request can u pls show some other way of attaching adventureworks database…

    Reply
  • Thanks a bunch,you saved me a lot of time.You made it seem so simple

    Reply
  • Sir, thanks for giving details about northwind and pubs….Can you tell me any site name to downlaod min 5000 Records.
    thanks
    arti

    Reply
  • Desde Medellín, Colombia, Muchas gracias, EXCELENTE !Funciona perfecto.
    :-)

    Reply
  • According to the installation package, AdventureWorks installed correctly but I can not find it in order to attach it.

    Also having trouble with attaching Northwind and Pubs. These I can find, but they fail to attach. I get the following message:

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

    Unable to open the physical file “C:\SQL Server 2000 Sample Databases\northwnd.mdf”. Operating system error 5: “5(Access is denied.)”. (Microsoft SQL Server, Error: 5120)

    I am really in need of a fix for this. Thanks in advance.

    Reply
  • Dear Pinal,

    many thanks for instructions, they helped a lot. I did attach successfully Northwind and Pubs databases.

    Kind regards,

    Shavkat.

    Reply
  • thanks man it helped me!!!

    Reply
  • gv me sample databses

    Reply
  • gr8 …. thanks alot

    Reply
  • Hi Pinal –

    You helped a lot! Great teaching skills – short and clear instructions. Thank you very much.

    Julia

    Reply
  • Dhirendra Singh Sengar
    October 15, 2008 4:09 pm

    Dear Sir,
    I m dhirendra Singh from DRDA, auraiya(UP). Plz, send me your course details and fee structure. I join your group.

    Dhirendra Singh

    Reply
  • Greate Job.!!

    Reply
  • Hey thanks for the information.
    It helped me to attach the sample databases

    Reply

Leave a Reply