Difference between revisions of "Sales.SalesOrderHeader (table)"
Line 549: | Line 549: | ||
| '''Object Type | | '''Object Type | ||
| '''Dependency Type | | '''Dependency Type | ||
− | + | ||
|- | |- | ||
| [[dbo.AccountNumber_(type)|dbo.AccountNumber]] | | [[dbo.AccountNumber_(type)|dbo.AccountNumber]] | ||
Line 562: | Line 562: | ||
| Type | | Type | ||
| Data Type | | Data Type | ||
+ | |- | ||
+ | | [[.Sales_(schema)|.Sales]] | ||
+ | | Schema | ||
+ | | Schema | ||
|- | |- | ||
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | | [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | ||
| Table | | Table | ||
| Select | | Select | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | | [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | ||
| Table | | Table | ||
| Update | | Update | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[Sales.SalesPerson_(table)|Sales.SalesPerson]] | | [[Sales.SalesPerson_(table)|Sales.SalesPerson]] | ||
| Table | | Table | ||
| Update | | Update | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | | [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]] | ||
| Table | | Table | ||
| Update | | Update | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[dbo.uspLogError_(procedure)|dbo.uspLogError]] | | [[dbo.uspLogError_(procedure)|dbo.uspLogError]] | ||
| Procedure | | Procedure | ||
| Execute | | Execute | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[dbo.uspPrintError_(procedure)|dbo.uspPrintError]] | | [[dbo.uspPrintError_(procedure)|dbo.uspPrintError]] | ||
| Procedure | | Procedure | ||
| Execute | | Execute | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[dbo.ufnGetAccountingEndDate_(function)|dbo.ufnGetAccountingEndDate]] | | [[dbo.ufnGetAccountingEndDate_(function)|dbo.ufnGetAccountingEndDate]] | ||
| Function | | Function | ||
| Execute | | Execute | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[dbo.ufnGetAccountingStartDate_(function)|dbo.ufnGetAccountingStartDate]] | | [[dbo.ufnGetAccountingStartDate_(function)|dbo.ufnGetAccountingStartDate]] | ||
| Function | | Function | ||
| Execute | | Execute | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|} | |} | ||
Line 602: | Line 622: | ||
| '''Object Type | | '''Object Type | ||
| '''Reference Type | | '''Reference Type | ||
− | + | ||
|- | |- | ||
| [[Sales.vSalesPersonSalesByFiscalYears_(view)|Sales.vSalesPersonSalesByFiscalYears]] | | [[Sales.vSalesPersonSalesByFiscalYears_(view)|Sales.vSalesPersonSalesByFiscalYears]] | ||
Line 611: | Line 631: | ||
| Table | | Table | ||
| Select | | Select | ||
+ | | Trigger | ||
+ | | iduSalesOrderDetail | ||
|- | |- | ||
| [[Sales.SalesOrderDetail_(table)|Sales.SalesOrderDetail]] | | [[Sales.SalesOrderDetail_(table)|Sales.SalesOrderDetail]] | ||
| Table | | Table | ||
| Update | | Update | ||
+ | | Trigger | ||
+ | | iduSalesOrderDetail | ||
|- | |- | ||
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | | [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | ||
| Table | | Table | ||
| Select | | Select | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|- | |- | ||
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | | [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]] | ||
| Table | | Table | ||
| Update | | Update | ||
+ | | Trigger | ||
+ | | uSalesOrderHeader | ||
|} | |} |
Revision as of 06:24, 30 November 2009
wikibot
Table | Sales.SalesOrderHeader |
Column | Data Type | Nullable | Default | PK | Index |
SalesOrderID | int | not null | PK_SalesOrderHeader_SalesOrderID | ||
RevisionNumber | tinyint | not null | ((0)) | ||
OrderDate | datetime | not null | (getdate()) | ||
DueDate | datetime | not null | |||
ShipDate | datetime | null | |||
Status | tinyint | not null | ((1)) | ||
OnlineOrderFlag | dbo.Flag | not null | ((1)) | ||
SalesOrderNumber | AK_SalesOrderHeader_SalesOrderNumber | ||||
PurchaseOrderNumber | dbo.OrderNumber | null | |||
AccountNumber | dbo.AccountNumber | null | |||
CustomerID | int | not null | IX_SalesOrderHeader_CustomerID | ||
ContactID | int | not null | |||
SalesPersonID | int | null | IX_SalesOrderHeader_SalesPersonID | ||
TerritoryID | int | null | |||
BillToAddressID | int | not null | |||
ShipToAddressID | int | not null | |||
ShipMethodID | int | not null | |||
CreditCardID | int | null | |||
CreditCardApprovalCode | varchar(15) | null | |||
CurrencyRateID | int | null | |||
SubTotal | money | not null | ((0.00)) | ||
TaxAmt | money | not null | ((0.00)) | ||
Freight | money | not null | ((0.00)) | ||
TotalDue | |||||
Comment | nvarchar(128) | null | |||
rowguid | uniqueidentifier | not null | (newid()) | AK_SalesOrderHeader_rowguid | |
ModifiedDate | datetime | not null | (getdate()) |
Relation | Column | Referenced Column |
Person.Address | BillToAddressID | AddressID |
Person.Address | ShipToAddressID | AddressID |
Person.Contact | ContactID | ContactID |
Sales.CreditCard | CreditCardID | CreditCardID |
Sales.CurrencyRate | CurrencyRateID | CurrencyRateID |
Sales.Customer | CustomerID | CustomerID |
Sales.SalesPerson | SalesPersonID | SalesPersonID |
Sales.SalesTerritory | TerritoryID | TerritoryID |
Purchasing.ShipMethod | ShipMethodID | ShipMethodID |
Detail Table | Column | Referencing Column |
Sales.SalesOrderDetail | SalesOrderID | SalesOrderID |
Sales.SalesOrderHeaderSalesReason | SalesOrderID | SalesOrderID |
Triggers | Type |
uSalesOrderHeader | ON UPDATE |
automatically generated
Table | Sales.SalesOrderHeader |
Description | General sales order information. |
Column | Data Type | Nullable | Default | Description / PK / Index |
SalesOrderID | int | not null | Primary key. PK_SalesOrderHeader_SalesOrderID | |
RevisionNumber | tinyint | not null | (0) | Incremental number to track changes to the sales order over time. |
OrderDate | datetime | not null | (GETDATE()) | 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 | (1) | Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled |
OnlineOrderFlag | Flag | not null | (1) | 0 = Order placed by sales person. 1 = Order placed online by customer. |
SalesOrderNumber | Unique sales order identification number. AK_SalesOrderHeader_SalesOrderNumber | |||
PurchaseOrderNumber | OrderNumber | null | Customer purchase order number reference. | |
AccountNumber | AccountNumber | null | Financial accounting number reference. | |
CustomerID | int | not null | Customer identification number. Foreign key to Customer.CustomerID. IX_SalesOrderHeader_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. IX_SalesOrderHeader_SalesPersonID | |
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 | (0.00) | Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. |
TaxAmt | money | not null | (0.00) | Tax amount. |
Freight | money | not null | (0.00) | Shipping cost. |
TotalDue | Total due from customer. Computed as Subtotal + TaxAmt + Freight. | |||
Comment | nvarchar(128) | null | Sales representative comments. | |
rowguid | uniqueidentifier | not null | (NEWID()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. AK_SalesOrderHeader_rowguid |
ModifiedDate | datetime | not null | (GETDATE()) | Date and time the record was last updated. |
Relation | Column | Referenced Column |
Person.Address | BillToAddressID | AddressID |
Person.Address | ShipToAddressID | AddressID |
Person.Contact | ContactID | ContactID |
Sales.CreditCard | CreditCardID | CreditCardID |
Sales.CurrencyRate | CurrencyRateID | CurrencyRateID |
Sales.Customer | CustomerID | CustomerID |
Sales.SalesPerson | SalesPersonID | SalesPersonID |
Sales.SalesTerritory | TerritoryID | TerritoryID |
Purchasing.ShipMethod | ShipMethodID | ShipMethodID |
Detail Table | Column | Referencing Column |
Sales.SalesOrderDetail | SalesOrderID | SalesOrderID |
Sales.SalesOrderHeaderSalesReason | SalesOrderID | SalesOrderID |
Triggers | Type |
uSalesOrderHeader | ON UPDATE |
Referenced Object | Object Type | Dependency Type | ||
dbo.AccountNumber | Type | Data Type | ||
dbo.Flag | Type | Data Type | ||
dbo.OrderNumber | Type | Data Type | ||
.Sales | Schema | Schema | ||
Sales.SalesOrderHeader | Table | Select | Trigger | uSalesOrderHeader |
Sales.SalesOrderHeader | Table | Update | Trigger | uSalesOrderHeader |
Sales.SalesPerson | Table | Update | Trigger | uSalesOrderHeader |
Sales.SalesTerritory | Table | Update | Trigger | uSalesOrderHeader |
dbo.uspLogError | Procedure | Execute | Trigger | uSalesOrderHeader |
dbo.uspPrintError | Procedure | Execute | Trigger | uSalesOrderHeader |
dbo.ufnGetAccountingEndDate | Function | Execute | Trigger | uSalesOrderHeader |
dbo.ufnGetAccountingStartDate | Function | Execute | Trigger | uSalesOrderHeader |
Referencing Object | Object Type | Reference Type | ||
Sales.vSalesPersonSalesByFiscalYears | View | Select | ||
Sales.SalesOrderDetail | Table | Select | Trigger | iduSalesOrderDetail |
Sales.SalesOrderDetail | Table | Update | Trigger | iduSalesOrderDetail |
Sales.SalesOrderHeader | Table | Select | Trigger | uSalesOrderHeader |
Sales.SalesOrderHeader | Table | Update | Trigger | uSalesOrderHeader |