|
Northwind Sample DatabaseThis article analyzes the Northwind sample database first offered with Microsoft SQL Server 2000.
Related Topics: | Screen: Max • 1024 • 800
|
Northwind and Pubs SamplesMany books and tutorials on SQL Server refer to the NorthWind (and its PUBS) sample database. There are several versions of Northwind. Download Micorosoft's Access 2000 Northwind.mdb The extracts file Nwind.exe which extracts to 1,510 KB Nwind.mdb, which is convert to Nwind2002.mdb when opened using MS-Access 2003 or 2007.
Download from Microsoft SQL2000SampleDb.msi for SQL Server 2000
(1.5MB file dated 4/8/2004). This is not available from CodePlex.
Running this results only in the creation of folder
instpubs.sql which loads PUBS.MDF and PUBS_LOG.LDF The Access .MDB version has a smaller number of tables than the SQL Server version, but the same number rows for the same tables. |
Loading Northwind Into SQL 2008
To load the data in SQL 2005 and 2008 (instead of the osql command in SQL 2000),
open a command windows and run this against the default SQL server instance:
sqlcmd -i instnwnd.sql Changed database context to 'master'. Changed database context to 'Northwind'. sqlcmd -i instpubs.sql Changed database context to 'master'. Beginning InstPubs.SQL at 03 Jan 200X 19:03:21:470 .... Creating pubs database.... Changed database context to 'pubs'. Now at the create table section .... Now at the create trigger section ... Now at the inserts to authors .... Now at the inserts to publishers .... Now at the inserts to pub_info .... Now at the inserts to titles .... Now at the inserts to titleauthor .... Now at the inserts to stores .... Now at the inserts to sales .... Now at the inserts to roysched .... Now at the inserts to discounts .... Now at the inserts to jobs .... Now at the inserts to employee .... Now at the create index section .... Now at the create view section .... Now at the create procedure section .... Changed database context to 'master'. Ending InstPubs.SQL at 03 Jan 200X 19:03:30:217 .... Pinal Dava offers other ways to install Northwind on SQL 2005, which a reader said also works for 2008.
To interactively make SQL Server a file using Enterprise Manager,
copy the mdf and ldf file into a folder like:
In EM 2005, Database and choose all task and select Attach DB In the Enterprise Manager 2008 Object Explorer, right Click on Databases, then Attach... If you have a .ldf file with the .mdf file, rather than use sp_attach_db procedure (especially from unknown or untrusted sources), use T-SQL command
If you don't have an .ldf file,
this article describes use of
|
Northwind Physical Schema
There are 8 data tables in the NorthWind MDB database.
The above was run on SQL 2008 on a 64-bit machine. Notice the doubling of space versus the
|
Click to pop-up a
full-size image of this Nwind MDB schema diagram: |
Pubs SchemaThis was obtained by running EXEC sp_spaceused 'author' within SQL 2008 on a 32-bit machine.
|
CodeSmith 4 generated the Admin application shown from the Northwind database using
.NetTiers 2.0 in the back-end on SQL Server 2005, based on
Microsoft's Enterprise Library of reusable software components (application blocks) open source code
addressing challenges common to complex, enterprise-level line-of-business development projects.
Correspondence of .NET, VS, and Entlib
Generated Admin screen:
The generation was based on these CodeSmith properties:
Share This |
Next |
|
Performance and Capacity Management...
| Syndicate this list of links: |
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Human verify: |