Delen via


SalesOrderHeader Table (AdventureWorks)

Contains the general, or parent, sales order information. The specific products associated with the sales order are stored in SalesOrderDetail Table.

SalesOrderHeader Table Definition

The SalesOrderHeader table is contained in the Sales schema.

Column Data type Nullability Description

SalesOrderID

int

Not null

Primary key.

RevisionNumber

tinyint

Not null

Incremental number to track changes to the sales order over time.

OrderDate

datetime

Not null

Dates the sales order was created.

DueDate

datetime

Not null

Date the order is due to the customer.

ShipDate

datetime

Null

Date the order was shipped to the customer.

Status

tinyint

Not null

Order current status. 1 = In process

2 = Approved

3 = Back ordered

4 = Rejected

5 = Shipped

6 = Canceled

OnlineOrderFlag

Flag (user-defined type)

bit

Not null

0 = Order placed by sales person.

1 = Order placed online by customer.

SalesOrderNumber

nvarchar(25)

Not null

Unique sales order identification number.

PurchaseOrderNumber

OrderNumber (user-defined type)

nvarchar(25)

Null

Customer purchase order number reference.

AccountNumber

AccountNumber (user-defined type)

nvarchar(15)

Null

Financial accounting number reference.

CustomerID

int

Not null

Customer identification number. Foreign key to Customer.CustomerID.

ContactID

int

Not null

Customer contact identification number. Foreign key to Contact.ContactID.

SalesPersonID

int

Null

Sales person who created the sales order. Foreign key to SalesPerson.SalePersonID.

TerritoryID

int

Null

Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID.

BillToAddressID

int

Not null

Customer billing address. Foreign key to Address.AddressID.

ShipToAddressID

int

Not null

Customer shipping address. Foreign key to Address.AddressID.

ShipMethodID

int

Not null

Shipping method. Foreign key to ShipMethod.ShipMethodID.

CreditCardID

int

Null

Credit card identification number. Foreign key to CreditCard.CreditCardID.

CreditCardApprovalCode

varchar(15)

Null

Approval code provided by the credit card company.

CurrencyRateID

int

Null

Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID.

SubTotal

money

Not null

Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal) for the SalesOrderID.

TaxAmt

money

Not null

Tax amount.

Freight

money

Not null

Shipping cost.

TotalDue

Computed as SubTotal + TaxAmt + Freight

Not null

Total due from customer.

Comment

nvarchar(128)

Null

Comments made by the sales representative.

rowguid

uniqueidentifier ROWGUIDCOL

Not null

ROWGUIDCOL number uniquely identifying the row. Used to support a merge replication sample.

ModifiedDate

datetime

Not null

Date and time the row was last updated.

See Also

Reference

Address Table (AdventureWorks)
CreditCard Table (AdventureWorks)
CurrencyRate Table (AdventureWorks)
Customer Table (AdventureWorks)
SalesPerson Table (AdventureWorks)
SalesOrderDetail Table (AdventureWorks)
SalesOrderHeaderSalesReason Table (AdventureWorks)

Other Resources

AdventureWorks Data Dictionary

Help and Information

Getting SQL Server 2005 Assistance