AdventureWorks2019
Purchasing.PurchaseOrderHeader
//
General purchase order information. See PurchaseOrderDetail.
Created: Modified:
Columns
-
//${escapify(column.description)}[int] IDENTITY (1,1) NOT NULL
-
//${escapify(column.description)}[tinyint] NOT NULL DEFAULT ((0))
-
//${escapify(column.description)}[tinyint] NOT NULL DEFAULT ((1))//CONSTRAINT: Check constraint [Status] BETWEEN (1) AND (4)([Status]>=(1) AND [Status]<=(4))
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[datetime] NOT NULL DEFAULT (getdate())
-
//${escapify(column.description)}[datetime] NULL
-
//${escapify(column.description)}[money] NOT NULL DEFAULT ((0.00))//CONSTRAINT: Check constraint [SubTotal] >= (0.00)([SubTotal]>=(0.00))
-
//${escapify(column.description)}[money] NOT NULL DEFAULT ((0.00))//CONSTRAINT: Check constraint [TaxAmt] >= (0.00)([TaxAmt]>=(0.00))
-
//${escapify(column.description)}[money] NOT NULL DEFAULT ((0.00))//CONSTRAINT: Check constraint [Freight] >= (0.00)([Freight]>=(0.00))
-
//${escapify(column.description)}[money] NOT NULL
-
//${escapify(column.description)}[datetime] NOT NULL DEFAULT (getdate())
Indexes
-
//Clustered index created by a primary key constraint.PK_PurchaseOrderHeader_PurchaseOrderIDUNIQUE CLUSTEREDPurchaseOrderID
-
//Nonclustered index.IX_PurchaseOrderHeader_VendorIDNONCLUSTEREDVendorID
-
//Nonclustered index.IX_PurchaseOrderHeader_EmployeeIDNONCLUSTEREDEmployeeID
Foreign Keys
-
//Foreign key constraint referencing Employee.EmployeeID.FK_PurchaseOrderHeader_Employee_EmployeeIDHumanResources.EmployeeEmployeeID ⥱ BusinessEntityID
-
//Foreign key constraint referencing ShipMethod.ShipMethodID.FK_PurchaseOrderHeader_ShipMethod_ShipMethodIDPurchasing.ShipMethodShipMethodID ⥱ ShipMethodID
-
//Foreign key constraint referencing Vendor.VendorID.FK_PurchaseOrderHeader_Vendor_VendorIDPurchasing.VendorVendorID ⥱ BusinessEntityID
Check Constraints
-
//Check constraint [ShipDate] >= [OrderDate] OR [ShipDate] IS NULLCK_PurchaseOrderHeader_ShipDate([ShipDate]>=[OrderDate] OR [ShipDate] IS NULL)
Sample Data
PurchaseOrderID
RevisionNumber
Status
EmployeeID
VendorID
ShipMethodID
OrderDate
ShipDate
SubTotal
TaxAmt
Freight
TotalDue
ModifiedDate
1
4
4
258
1580
3
201.04
16.0832
5.026
222.1492
2
4
1
254
1496
5
272.1015
21.7681
6.8025
300.6721
3
4
4
257
1494
2
8847.3
707.784
221.1825
9776.2665
4
4
3
261
1650
5
171.0765
13.6861
4.2769
189.0395
5
4
4
251
1654
4
20397.3
1631.784
509.9325
22539.0165
6
4
4
253
1664
3
14628.075
1170.246
365.7019
16164.0229
7
4
4
255
1678
3
58685.55
4694.844
1467.1388
64847.5328
8
4
4
256
1616
5
693.378
55.4702
17.3345
766.1827
9
5
4
259
1492
5
694.1655
55.5332
17.3541
767.0528
10
4
4
250
1602
5
1796.0355
143.6828
44.9009
1984.6192
11
4
4
258
1540
4
501.1965
40.0957
12.5299
553.8221
12
4
4
254
1628
5
34644.225
2771.538
866.1056
38281.8686
13
4
4
257
1604
4
1839.5055
147.1604
45.9876
2032.6535
14
4
3
261
1690
5
146.286
11.7029
3.6572
161.6461
15
4
4
251
1566
5
102.564
8.2051
2.5641
113.3332
16
4
4
253
1698
5
150.7905
12.0632
3.7698
166.6235
17
4
4
255
1560
5
13669.425
1093.554
341.7356
15104.7146
18
4
4
256
1692
5
16393.23
1311.4584
409.8308
18114.5192
19
4
4
259
1696
2
79204.125
6336.33
1980.1031
87520.5581
20
4
4
260
1504
1
551.88
44.1504
13.797
609.8274
21
4
4
250
1544
1
6987.75
559.02
174.6938
7721.4638
22
4
4
254
1530
2
28072.275
2245.782
701.8069
31019.8639
23
4
4
257
1508
1
37312.275
2984.982
932.8069
41230.0639
24
4
3
261
1694
1
4215.75
337.26
105.3938
4658.4038
25
4
4
251
1624
2
28297.5
2263.8
707.4375
31268.7375