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
191 Comments. Leave new
Thank you I have successfully Installed it,
Peace
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)
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!
Hey, oceans of thanks!!!!! It worked…
Thank you so much! it is very helpful and quick.
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 .
Hai arvind,
I face the same problem. have u got the solution?
Hey its Really gud…..
thanx a million….
Many thanks. You made it easy.
Thanks for the help!
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!
I install the SQL Server 2008 but the enterprise and Query Analizer are not on it that I create a database why?
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.
I need a sample in sql server quickly if somebody know about dowloading it please send to me
very useful post.
thank you very much for the great help
I have adventurework database, but i couldn’t work it, pls send step to step work adventurework database
thanks…i got help from this article…nice article and nice blog..
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 .
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
Hi,
Thks… superb wrk…