Purchasing.PurchaseOrderHeader Table

Information

NamePurchaseOrderHeader
SchemaPurchasing
Row Count0
Data Size 
Index Size 
Reserved Size 
Unused Size 
Created29.3.2010. 21:58:18
Modified29.3.2010. 21:58:56

Extended Properties

NameTypeProperty NameValue
PurchaseOrderHeaderTABLEMS_DescriptionGeneral purchase order information. See PurchaseOrderDetail.

Columns

PKKeyIdentityNameData TypeAllow NullsCollationReferencesDefaultComputedCompute Expression
   PurchaseOrderIDint   
 
 
 
   RevisionNumbertinyint   
((0))
 
 
   Statustinyint   
((1))
 
 
   EmployeeIDint  HumanResources.Employee.EmployeeID
 
 
 
   VendorIDint  Purchasing.Vendor.VendorID
 
 
 
   ShipMethodIDint  Purchasing.ShipMethod.ShipMethodID
 
 
 
   OrderDatedatetime   
(getdate())
 
 
   ShipDatedatetime   
 
 
 
   SubTotalmoney   
((0.00))
 
 
   TaxAmtmoney   
((0.00))
 
 
   Freightmoney   
((0.00))
 
 
   TotalDuemoney   
 
 
(isnull(([SubTotal]+[TaxAmt])+[Freight],(0)))
   ModifiedDatedatetime   
(getdate())
 
 

Indexes

NameTypePrimaryUniqueColumns
PK_PurchaseOrderHeader_PurchaseOrderIDClustered  PurchaseOrderID
IX_PurchaseOrderHeader_VendorIDNonClustered  VendorID
IX_PurchaseOrderHeader_EmployeeIDNonClustered  EmployeeID

Check Constraints

NameColumnEnabledTrustedExpression
CK_PurchaseOrderHeader_ShipDate   ([ShipDate]>=[OrderDate] OR [ShipDate] IS NULL)
CK_PurchaseOrderHeader_StatusStatus  ([Status]>=(1) AND [Status]<=(4))
CK_PurchaseOrderHeader_SubTotalSubTotal  ([SubTotal]>=(0.00))
CK_PurchaseOrderHeader_TaxAmtTaxAmt  ([TaxAmt]>=(0.00))
CK_PurchaseOrderHeader_FreightFreight  ([Freight]>=(0.00))

Foreign Key Constraints

NameTypeReferenced Table
FK_PurchaseOrderHeader_Employee_EmployeeIDForeign keyHumanResources.Employee
FK_PurchaseOrderHeader_ShipMethod_ShipMethodIDForeign keyPurchasing.ShipMethod
FK_PurchaseOrderHeader_Vendor_VendorIDForeign keyPurchasing.Vendor

Triggers

NameActivates onInstead OfFor ReplicationEnabledCreatedModified
uPurchaseOrderHeaderUPDATE   29.3.2010. 21:58:5629.3.2010. 21:58:56

SQL Script

CREATE TABLE [Purchasing].[PurchaseOrderHeader] (
    [PurchaseOrderID] int NOT NULL IDENTITY,
    [RevisionNumber] tinyint NOT NULL DEFAULT ((0)),
    [Status] tinyint NOT NULL DEFAULT ((1)),
    [EmployeeID] int NOT NULL,
    [VendorID] int NOT NULL,
    [ShipMethodID] int NOT NULL,
    [OrderDate] datetime NOT NULL DEFAULT (getdate()),
    [ShipDate] datetime NULL,
    [SubTotal] money NOT NULL DEFAULT ((0.00)),
    [TaxAmt] money NOT NULL DEFAULT ((0.00)),
    [Freight] money NOT NULL DEFAULT ((0.00)),
    [TotalDue] money NOT NULL,
    [ModifiedDate] datetime NOT NULL DEFAULT (getdate())
);
CREATE INDEX [IX_PurchaseOrderHeader_VendorID] on [Purchasing].[PurchaseOrderHeader]([VendorID]);
CREATE INDEX [IX_PurchaseOrderHeader_EmployeeID] on [Purchasing].[PurchaseOrderHeader]([EmployeeID]);