Tech Junkie Blog - Real World Tutorials, Happy Coding!: Install the Northwind Sample Database

Sunday, June 19, 2016

Install the Northwind Sample Database

If you look on the web you will eventually find an example that refers to the Northwind sample database in one of the their examples.  What they fell to tell you is where to find this sample database and how to add to your database.

Follow these steps to add the Northwind sample database to your SQL Server:

1. Go the URL and download the Northwind and pubs sample database from Microsoft.

Microsoft Sample Northwind Database Download Button

2. Double click on the SQL2000SampleDb.msi file, then click "Run"

SQL2000SampleDb.msi Executable File

3. After you finished with the installer you will have the sample databases in the "SQL Server 2000 Sample Databases" folder in the C drive

4. Log onto SQL Server using SQL Server Management Studio

5. Right-click on the "Databases" node inside the "Object Explorer" window, then select "Attach"
Attache Northwind database

6. Click on the "Add" button, in the "Attach Database" window

SQL Server Attach Databases Wizard

7. Select the "NORTHWND.MDF" file inside the "SQL Server 2000 Sample Databases" folder
Select Northwind.MDF file

8. Click "OK"

Attach Northwind database

9. SQL Server will automatically create a log file for the .mdf file you just attached

Northwind database log file

10. Click "OK"

11. Northwind database is added to SQL Server

Northwind database attached

Note: You can perform the steps above for the pubs sample database, the only thing you have to watch out for is that some sample databases might not be compatible with your version of SQL Server.  In that case you will have to run the .sql script instead if you want to use the database.  There might be some trial and error involve if you have to run the sql script but it shouldn't be too bad.

No comments:

Post a Comment

Search This Blog