Difference between revisions of "Purchasing.PurchaseOrderHeader (table)"

From dbscript Online Help
Jump to: navigation, search
Line 184: Line 184:
 
| not null
 
| not null
 
|  
 
|  
| Primary key.PK_PurchaseOrderHeader_PurchaseOrderID
+
| Primary key.<br />PK_PurchaseOrderHeader_PurchaseOrderID
 
|- valign="top"
 
|- valign="top"
 
| RevisionNumber
 
| RevisionNumber
Line 190: Line 190:
 
| not null
 
| not null
 
| (0)
 
| (0)
| Incremental number to track changes to the purchase order over time.
+
| Incremental number to track changes to the purchase order over time.<br />
 
|- valign="top"
 
|- valign="top"
 
| Status
 
| Status
Line 196: Line 196:
 
| not null
 
| not null
 
| (1)
 
| (1)
| Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
+
| Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete<br />
 
|- valign="top"
 
|- valign="top"
 
| EmployeeID
 
| EmployeeID
Line 202: Line 202:
 
| not null
 
| not null
 
|  
 
|  
| Employee who created the purchase order. Foreign key to Employee.EmployeeID.IX_PurchaseOrderHeader_EmployeeID
+
| Employee who created the purchase order. Foreign key to Employee.EmployeeID.<br />IX_PurchaseOrderHeader_EmployeeID
 
|- valign="top"
 
|- valign="top"
 
| VendorID
 
| VendorID
Line 208: Line 208:
 
| not null
 
| not null
 
|  
 
|  
| Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.IX_PurchaseOrderHeader_VendorID
+
| Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.<br />IX_PurchaseOrderHeader_VendorID
 
|- valign="top"
 
|- valign="top"
 
| ShipMethodID
 
| ShipMethodID
Line 214: Line 214:
 
| not null
 
| not null
 
|  
 
|  
| Shipping method. Foreign key to ShipMethod.ShipMethodID.
+
| Shipping method. Foreign key to ShipMethod.ShipMethodID.<br />
 
|- valign="top"
 
|- valign="top"
 
| OrderDate
 
| OrderDate
Line 220: Line 220:
 
| not null
 
| not null
 
| (GETDATE())
 
| (GETDATE())
| Purchase order creation date.
+
| Purchase order creation date.<br />
 
|- valign="top"
 
|- valign="top"
 
| ShipDate
 
| ShipDate
Line 226: Line 226:
 
| null
 
| null
 
|  
 
|  
| Estimated shipment date from the vendor.
+
| Estimated shipment date from the vendor.<br />
 
|- valign="top"
 
|- valign="top"
 
| SubTotal
 
| SubTotal
Line 232: Line 232:
 
| not null
 
| not null
 
| (0.00)
 
| (0.00)
| Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.
+
| Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.<br />
 
|- valign="top"
 
|- valign="top"
 
| TaxAmt
 
| TaxAmt
Line 238: Line 238:
 
| not null
 
| not null
 
| (0.00)
 
| (0.00)
| Tax amount.
+
| Tax amount.<br />
 
|- valign="top"
 
|- valign="top"
 
| Freight
 
| Freight
Line 244: Line 244:
 
| not null
 
| not null
 
| (0.00)
 
| (0.00)
| Shipping cost.
+
| Shipping cost.<br />
 
|- valign="top"
 
|- valign="top"
 
| TotalDue
 
| TotalDue
Line 250: Line 250:
 
|  
 
|  
 
|  
 
|  
| Total due to vendor. Computed as Subtotal + TaxAmt + Freight.
+
| Total due to vendor. Computed as Subtotal + TaxAmt + Freight.<br />
 
|- valign="top"
 
|- valign="top"
 
| ModifiedDate
 
| ModifiedDate
Line 256: Line 256:
 
| not null
 
| not null
 
| (GETDATE())
 
| (GETDATE())
| Date and time the record was last updated.
+
| Date and time the record was last updated.<br />
 
|}
 
|}
  

Revision as of 01:10, 27 November 2009

wikibot

Table Purchasing.PurchaseOrderHeader


Column Data Type Nullable Default PK Index
PurchaseOrderID int not null PK_PurchaseOrderHeader_PurchaseOrderID
RevisionNumber tinyint not null ((0))
Status tinyint not null ((1))
EmployeeID int not null IX_PurchaseOrderHeader_EmployeeID
VendorID int not null IX_PurchaseOrderHeader_VendorID
ShipMethodID int not null
OrderDate datetime not null (getdate())
ShipDate datetime null
SubTotal money not null ((0.00))
TaxAmt money not null ((0.00))
Freight money not null ((0.00))
TotalDue
ModifiedDate datetime not null (getdate())


Relation Column Referenced Column
HumanResources.Employee EmployeeID EmployeeID
Purchasing.ShipMethod ShipMethodID ShipMethodID
Purchasing.Vendor VendorID VendorID


Detail Table Column Referencing Column
Purchasing.PurchaseOrderDetail PurchaseOrderID PurchaseOrderID


Triggers Type
uPurchaseOrderHeader ON UPDATE

automatically generated

Table Purchasing.PurchaseOrderHeader
Description General purchase order information. See PurchaseOrderDetail.


Column Data Type Nullable Default Description / PK / Index
PurchaseOrderID int not null Primary key.
PK_PurchaseOrderHeader_PurchaseOrderID
RevisionNumber tinyint not null (0) Incremental number to track changes to the purchase order over time.
Status tinyint not null (1) Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
EmployeeID int not null Employee who created the purchase order. Foreign key to Employee.EmployeeID.
IX_PurchaseOrderHeader_EmployeeID
VendorID int not null Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.
IX_PurchaseOrderHeader_VendorID
ShipMethodID int not null Shipping method. Foreign key to ShipMethod.ShipMethodID.
OrderDate datetime not null (GETDATE()) Purchase order creation date.
ShipDate datetime null Estimated shipment date from the vendor.
SubTotal money not null (0.00) Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.
TaxAmt money not null (0.00) Tax amount.
Freight money not null (0.00) Shipping cost.
TotalDue Total due to vendor. Computed as Subtotal + TaxAmt + Freight.
ModifiedDate datetime not null (GETDATE()) Date and time the record was last updated.


Relation Column Referenced Column
HumanResources.Employee EmployeeID EmployeeID
Purchasing.ShipMethod ShipMethodID ShipMethodID
Purchasing.Vendor VendorID VendorID


Detail Table Column Referencing Column
Purchasing.PurchaseOrderDetail PurchaseOrderID PurchaseOrderID


Triggers Type
uPurchaseOrderHeader ON UPDATE


Referenced Object Object Type Dependency Type
Purchasing.PurchaseOrderHeader Table Update
dbo.uspLogError Procedure Execute
dbo.uspPrintError Procedure Execute


Referencing Object Object Type Reference Type
Purchasing.PurchaseOrderDetail Table Select
Purchasing.PurchaseOrderDetail Table Update
Purchasing.PurchaseOrderDetail Table Update
Purchasing.PurchaseOrderHeader Table Update