SalesOrderHeader 表 (AdventureWorks)
包含常规或父级销售订单信息。与销售订单关联的特定产品存储在 SalesOrderDetail 表中。
SalesOrderHeader 表定义
SalesOrderHeader 表包含在 Sales 架构中。
列  | 
数据类型  | 
为空性  | 
说明  | 
|---|---|---|---|
SalesOrderID  | 
int  | 
非空  | 
主键。  | 
RevisionNumber  | 
tinyint  | 
非空  | 
随着时间的推移跟踪销售订单更改的递增编号。  | 
OrderDate  | 
datetime  | 
非空  | 
创建销售订单的日期。  | 
DueDate  | 
datetime  | 
非空  | 
客户订单到期的日期。  | 
ShipDate  | 
datetime  | 
Null  | 
订单发送给客户的日期。  | 
Status  | 
tinyint  | 
非空  | 
订单的当前状态。1 = 处理中 2 = 已批准 3 = 预定 4 = 已拒绝 5 = 已发货 6 = 已取消  | 
OnlineOrderFlag  | 
Flag(用户定义类型) bit  | 
非空  | 
0 = 销售人员下的订单。 1 = 客户在线下的订单。  | 
SalesOrderNumber  | 
nvarchar(25)  | 
非空  | 
唯一的销售订单标识号。  | 
PurchaseOrderNumber  | 
OrderNumber(用户定义类型) nvarchar(25)  | 
Null  | 
客户采购订单号引用。  | 
AccountNumber  | 
AccountNumber(用户定义类型) nvarchar(15)  | 
Null  | 
财务帐号引用。  | 
CustomerID  | 
int  | 
非空  | 
客户标识号。指向 Customer.CustomerID 的外键。  | 
ContactID  | 
int  | 
非空  | 
客户联系人标识号。指向 Contact.ContactID 的外键。  | 
SalesPersonID  | 
int  | 
Null  | 
创建销售订单的销售人员。指向 SalesPerson.SalePersonID 的外键。  | 
TerritoryID  | 
int  | 
Null  | 
进行销售的地区。指向 SalesTerritory.SalesTerritoryID 的外键。  | 
BillToAddressID  | 
int  | 
非空  | 
客户开票地址。指向 Address.AddressID 的外键。  | 
ShipToAddressID  | 
int  | 
非空  | 
客户收货地址。指向 Address.AddressID 的外键。  | 
ShipMethodID  | 
int  | 
非空  | 
发货方法。指向 ShipMethod.ShipMethodID 的外键。  | 
CreditCardID  | 
int  | 
Null  | 
信用卡标识号。指向 CreditCard.CreditCardID 的外键。  | 
CreditCardApprovalCode  | 
varchar(15)  | 
Null  | 
信用卡公司提供的批准代码。  | 
CurrencyRateID  | 
int  | 
Null  | 
所使用的外币兑换率。指向 CurrencyRate.CurrencyRateID 的外键。  | 
SubTotal  | 
money  | 
非空  | 
销售小计。SalesOrderID 的销售小计的计算方式为 SUM(SalesOrderDetail.LineTotal)。  | 
TaxAmt  | 
money  | 
非空  | 
税额。  | 
Freight  | 
money  | 
非空  | 
运费。  | 
TotalDue  | 
计算方式为 SubTotal + TaxAmt + Freight  | 
非空  | 
客户的应付款总计。  | 
Comment  | 
nvarchar(128)  | 
Null  | 
销售代表添加的注释。  | 
rowguid  | 
uniqueidentifier ROWGUIDCOL  | 
非空  | 
唯一标识行的 ROWGUIDCOL 号。用于支持合并复制示例。  | 
ModifiedDate  | 
datetime  | 
非空  | 
行的上次更新日期和时间。  |