AdventureWorks 2008 Details
The following changes have been made in the design of AdventureWorks2008:
- The way people and businesses are represented has changed. Some tables have been added, renamed, and deleted. These changes enable better integration with the Microsoft ADO.NET Entity Framework.
- New data types and attributes are now demonstrated in the database including:
- date and time
- hierarchyid
- geography
- filestream
- Integrated full-text support has been incorporated into the database.
The schema introduces the idea of a business entity. A business entity is a person or business which has zero or more addresses and zero or more people related to it. For example, the people related to a store would typically be purchasing agents of a retail sporting or bicycle store who buy bicycles wholesale from AdventureWorks Cycles. A person related to an employee might be the employee’s emergency contact. All business entities have a common key (the
BusinessEntityID). This allows us to build a conceptual model using the Entity Framework which demonstrates table per type inheritance. It also simplifies the schema by having a single table (
Person.BusinessEntityAddress) relate addresses to business entities instead of using specialized tables (for example
CustomerAddress,
VendorAddress,
EmployeeAddress.
The concept of a customer has also been broadened. In AdventureWorks for SQL Server 2005, a customer is either a store (wholesale) or an individual (retail). In AdventureWorks2008, a customer can be any person or a store. This enables employees (for example) to be customers without storing redundant information about them.
The
hierarchyid data type is used to organize employees and their managers into a tree, and organize production documents into a tree (much like a file system).
The
date and
time data types are used instead of the datetime data type when appropriate (date for columns like
HireDate in the
HumanResources.Employee table, and time for columns like
StartTime in
HumanResources.Shift table).
The integrated full-text feature of SQL Server 2008 is used to demonstrate full-text querying over resumes stored in the
HumanResources.JobCandidate table.
Fictitious addresses stored in the
Person.Address table have been fictionally geocoded and the result stored in the
SpatialLocation column to demonstrate the new spatial features in SQL Server 2008.
For specific information about these changes an entity relational diagram showing the conceptual model of business entities, a relational schema diagram, a Transact-SQL script and the CSV data files necessary to build the database are included in the AdventureWorks2008Scripts.msi installer located in
The Sample Databases at CodePlex project.
AdventureWorks 2008 Installation
To install AdventureWorks2008 perform the following steps:
1. Make sure you have installed the full-text search engine and enabled FILESTREAM during the installation process for the SQL Server 2008 instance where you will be using the sample database.
2. Follow the step by step instructions located
here.
Note: EF 1.0 Compatibility Issues
The Entity Framework team would like us to let you know that AdventureWorks2008 is a little bit ahead of the curve in terms of the Katmai features it uses. Some datatypes in AdventureWorks2008 (such as hierarchyid and geometry) are not supported in the entity framework, and some datatypes like date and time can cause problems. The workaround is to exclude tables like Production.Document from your model if possible since there is currently no support for the hierarchyid datatype in Entity Framework 1.0. Unfortunately the Entity Framework tooling which updates your model from the database will pull in tables like Production.Document even if they were specifically excluded when the model was created, so use of that feature on AdventureWorks2008 is not supported at this time. We look forward to a follow-on release of Entity Framework which has full Katmai type support.