WideWorldImporters
Warehouse.StockItemTransactions
//
Transactions covering all movements of all stock items
Created: Modified:
Columns
-
//${escapify(column.description)}[int] NOT NULL DEFAULT (NEXT VALUE FOR [Sequences].[TransactionID])
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NULL
-
//${escapify(column.description)}[int] NULL
-
//${escapify(column.description)}[int] NULL
-
//${escapify(column.description)}[int] NULL
-
//${escapify(column.description)}[datetime2](8) NOT NULL
-
//${escapify(column.description)}[decimal](18, 3) NOT NULL
-
[int] NOT NULL
-
[datetime2](8) NOT NULL DEFAULT (sysdatetime())
Indexes
-
CCX_Warehouse_StockItemTransactionsCLUSTERED COLUMNSTOREStockItemTransactionID , StockItemID , TransactionTypeID , CustomerID , InvoiceID , SupplierID , PurchaseOrderID , TransactionOccurredWhen , Quantity , LastEditedBy , LastEditedWhen
-
//Auto-created to support a foreign keyFK_Warehouse_StockItemTransactions_StockItemIDNONCLUSTEREDStockItemID
-
//Auto-created to support a foreign keyFK_Warehouse_StockItemTransactions_TransactionTypeIDNONCLUSTEREDTransactionTypeID
-
//Auto-created to support a foreign keyFK_Warehouse_StockItemTransactions_CustomerIDNONCLUSTEREDCustomerID
-
//Auto-created to support a foreign keyFK_Warehouse_StockItemTransactions_InvoiceIDNONCLUSTEREDInvoiceID
-
//Auto-created to support a foreign keyFK_Warehouse_StockItemTransactions_SupplierIDNONCLUSTEREDSupplierID
-
//Auto-created to support a foreign keyFK_Warehouse_StockItemTransactions_PurchaseOrderIDNONCLUSTEREDPurchaseOrderID
-
PK_Warehouse_StockItemTransactionsUNIQUE NONCLUSTEREDStockItemTransactionID
Foreign Keys
-
FK_Warehouse_StockItemTransactions_Application_PeopleApplication.PeopleLastEditedBy ⥱ PersonID
-
FK_Warehouse_StockItemTransactions_CustomerID_Sales_CustomersSales.CustomersCustomerID ⥱ CustomerID
-
FK_Warehouse_StockItemTransactions_InvoiceID_Sales_InvoicesSales.InvoicesInvoiceID ⥱ InvoiceID
-
FK_Warehouse_StockItemTransactions_PurchaseOrderID_Purchasing_PurchaseOrdersPurchasing.PurchaseOrdersPurchaseOrderID ⥱ PurchaseOrderID
-
FK_Warehouse_StockItemTransactions_StockItemID_Warehouse_StockItemsWarehouse.StockItemsStockItemID ⥱ StockItemID
-
FK_Warehouse_StockItemTransactions_SupplierID_Purchasing_SuppliersPurchasing.SuppliersSupplierID ⥱ SupplierID
-
FK_Warehouse_StockItemTransactions_TransactionTypeID_Application_TransactionTypesApplication.TransactionTypesTransactionTypeID ⥱ TransactionTypeID
Sample Data
StockItemTransactionID
StockItemID
TransactionTypeID
CustomerID
InvoiceID
SupplierID
PurchaseOrderID
TransactionOccurredWhen
Quantity
LastEditedBy
LastEditedWhen
6293
213
10
28
1325
NULL
NULL
-10
4
6304
10
10
183
1329
NULL
NULL
-10
4
6311
161
10
565
1331
NULL
NULL
-10
4
6312
64
10
565
1331
NULL
NULL
-10
4
6337
61
10
407
1336
NULL
NULL
-10
4
6338
51
10
407
1336
NULL
NULL
-10
4
6344
171
10
66
1338
NULL
NULL
-10
4
6364
39
10
26
1343
NULL
NULL
-10
4
6380
157
10
830
1347
NULL
NULL
-10
4
6425
173
10
155
1356
NULL
NULL
-10
4
6484
116
10
136
1364
NULL
NULL
-10
4
6488
173
10
8
1365
NULL
NULL
-10
4
6501
116
10
152
1367
NULL
NULL
-10
4
6502
32
10
152
1367
NULL
NULL
-10
4
6511
70
10
80
1369
NULL
NULL
-10
4
6516
48
10
587
1370
NULL
NULL
-10
4
6539
218
10
949
1375
NULL
NULL
-10
4
6577
63
10
497
1383
NULL
NULL
-10
4
6579
36
10
957
1384
NULL
NULL
-10
4
6605
122
10
573
1390
NULL
NULL
-10
4
6657
169
10
852
1401
NULL
NULL
-10
4
6658
42
10
852
1401
NULL
NULL
-10
4
6682
163
10
116
1406
NULL
NULL
-10
4
6701
161
10
527
1410
NULL
NULL
-10
4
6714
211
10
427
1413
NULL
NULL
-10
4