Field Name | Data Type | Size | Original Type | Default | Nullable | Description | Check |
SalesOrderID | int identity | | int | | Not null | Primary key. | |
RevisionNumber | tinyint | | | (0) | Not null | Incremental number to track changes to the sales order over time. | |
OrderDate | datetime | | | getdate() | 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 | | | (1) | Not null | Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled | ([Status]>=(0) AND [Status]<=(8)) |
OnlineOrderFlag | Flag | | bit | (1) | 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 | | nvarchar(25) | | Null | Customer purchase order number reference. | |
AccountNumber | AccountNumber | | 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 | 19,4 | decimal(19,4) | (0.00) | Not null | Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. | ([SubTotal]>=(0.00)) |
TaxAmt | money | 19,4 | decimal(19,4) | (0.00) | Not null | Tax amount. | ([TaxAmt]>=(0.00)) |
Freight | money | 19,4 | decimal(19,4) | (0.00) | Not null | Shipping cost. | ([Freight]>=(0.00)) |
TotalDue | money | 19,4 | decimal(19,4) | | Not null | Total due from customer. Computed as Subtotal + TaxAmt + Freight. | |
Comment | nvarchar | 128 | | | Null | Sales representative comments. | |
rowguid | uniqueidentifier | | | newid() | Not null | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |
ModifiedDate | datetime | | | getdate() | Not null | Date and time the record was last updated. | |
The object has no extended properties.
Foreign | Primary | Key Name |
SalesOrderHeader.BillToAddressID | Address.AddressID | FK_SalesOrderHeader_Address_BillToAddressID |
SalesOrderHeader.ShipToAddressID | Address.AddressID | FK_SalesOrderHeader_Address_ShipToAddressID |
SalesOrderHeader.ContactID | Contact.ContactID | FK_SalesOrderHeader_Contact_ContactID |
SalesOrderHeader.ShipMethodID | ShipMethod.ShipMethodID | FK_SalesOrderHeader_ShipMethod_ShipMethodID |
SalesOrderHeader.CreditCardID | CreditCard.CreditCardID | FK_SalesOrderHeader_CreditCard_CreditCardID |
SalesOrderHeader.CurrencyRateID | CurrencyRate.CurrencyRateID | FK_SalesOrderHeader_CurrencyRate_CurrencyRateID |
SalesOrderHeader.CustomerID | Customer.CustomerID | FK_SalesOrderHeader_Customer_CustomerID |
SalesOrderHeader.SalesPersonID | SalesPerson.SalesPersonID | FK_SalesOrderHeader_SalesPerson_SalesPersonID |
SalesOrderHeader.TerritoryID | SalesTerritory.TerritoryID | FK_SalesOrderHeader_SalesTerritory_TerritoryID |