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

From dbscript Online Help
Jump to: navigation, search
Line 156: Line 156:
 
| ON UPDATE
 
| ON UPDATE
 
|}
 
|}
 
 
== automatically generated ==
 
== automatically generated ==
  
Line 178: Line 177:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''Description
+
| '''Description / PK / Index
| '''PK / Index
 
 
 
|-
+
|- valign="top"
 
| PurchaseOrderID
 
| PurchaseOrderID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| Primary key.
+
| Primary key.PK_PurchaseOrderHeader_PurchaseOrderID
| PK_PurchaseOrderHeader_PurchaseOrderID
+
|- valign="top"
|-
 
 
| RevisionNumber
 
| RevisionNumber
 
| tinyint
 
| tinyint
Line 194: Line 191:
 
| (0)
 
| (0)
 
| Incremental number to track changes to the purchase order over time.
 
| Incremental number to track changes to the purchase order over time.
|
+
|- valign="top"
|-
 
 
| Status
 
| Status
 
| tinyint
 
| tinyint
Line 201: Line 197:
 
| (1)
 
| (1)
 
| Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
 
| Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
|
+
|- valign="top"
|-
 
 
| EmployeeID
 
| EmployeeID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| Employee who created the purchase order. Foreign key to Employee.EmployeeID.
+
| Employee who created the purchase order. Foreign key to Employee.EmployeeID.IX_PurchaseOrderHeader_EmployeeID
| IX_PurchaseOrderHeader_EmployeeID
+
|- valign="top"
|-
 
 
| VendorID
 
| VendorID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.
+
| Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.IX_PurchaseOrderHeader_VendorID
| IX_PurchaseOrderHeader_VendorID
+
|- valign="top"
|-
 
 
| ShipMethodID
 
| ShipMethodID
 
| int
 
| int
Line 222: Line 215:
 
|  
 
|  
 
| Shipping method. Foreign key to ShipMethod.ShipMethodID.
 
| Shipping method. Foreign key to ShipMethod.ShipMethodID.
|
+
|- valign="top"
|-
 
 
| OrderDate
 
| OrderDate
 
| datetime
 
| datetime
Line 229: Line 221:
 
| (GETDATE())
 
| (GETDATE())
 
| Purchase order creation date.
 
| Purchase order creation date.
|
+
|- valign="top"
|-
 
 
| ShipDate
 
| ShipDate
 
| datetime
 
| datetime
Line 236: Line 227:
 
|  
 
|  
 
| Estimated shipment date from the vendor.
 
| Estimated shipment date from the vendor.
|
+
|- valign="top"
|-
 
 
| SubTotal
 
| SubTotal
 
| money
 
| money
Line 243: Line 233:
 
| (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.
|
+
|- valign="top"
|-
 
 
| TaxAmt
 
| TaxAmt
 
| money
 
| money
Line 250: Line 239:
 
| (0.00)
 
| (0.00)
 
| Tax amount.
 
| Tax amount.
|
+
|- valign="top"
|-
 
 
| Freight
 
| Freight
 
| money
 
| money
Line 257: Line 245:
 
| (0.00)
 
| (0.00)
 
| Shipping cost.
 
| Shipping cost.
|
+
|- valign="top"
|-
 
 
| TotalDue
 
| TotalDue
 
|  
 
|  
Line 264: Line 251:
 
|  
 
|  
 
| Total due to vendor. Computed as Subtotal + TaxAmt + Freight.
 
| Total due to vendor. Computed as Subtotal + TaxAmt + Freight.
|
+
|- valign="top"
|-
 
 
| ModifiedDate
 
| ModifiedDate
 
| datetime
 
| datetime
Line 271: Line 257:
 
| (GETDATE())
 
| (GETDATE())
 
| Date and time the record was last updated.
 
| Date and time the record was last updated.
|
 
 
|}
 
|}
  
Line 318: Line 303:
 
| uPurchaseOrderHeader
 
| uPurchaseOrderHeader
 
| ON UPDATE
 
| ON UPDATE
 +
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Referenced Object
 +
| '''Object Type
 +
| '''Dependency Type
 +
 +
|-
 +
| [[Purchasing.PurchaseOrderHeader_(table)|Purchasing.PurchaseOrderHeader]]
 +
| Table
 +
| Update
 +
|-
 +
| [[dbo.uspLogError_(procedure)|dbo.uspLogError]]
 +
| Procedure
 +
| Execute
 +
|-
 +
| [[dbo.uspPrintError_(procedure)|dbo.uspPrintError]]
 +
| Procedure
 +
| Execute
 +
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Referencing Object
 +
| '''Object Type
 +
| '''Reference Type
 +
 +
|-
 +
| [[Purchasing.PurchaseOrderDetail_(table)|Purchasing.PurchaseOrderDetail]]
 +
| Table
 +
| Select
 +
|-
 +
| [[Purchasing.PurchaseOrderDetail_(table)|Purchasing.PurchaseOrderDetail]]
 +
| Table
 +
| Update
 +
|-
 +
| [[Purchasing.PurchaseOrderDetail_(table)|Purchasing.PurchaseOrderDetail]]
 +
| Table
 +
| Update
 +
|-
 +
| [[Purchasing.PurchaseOrderHeader_(table)|Purchasing.PurchaseOrderHeader]]
 +
| Table
 +
| Update
 
|}
 
|}

Revision as of 23:57, 26 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