Databases > WideWorldImporters > Tables > Warehouse.StockItemTransactions

WideWorldImporters

Warehouse.StockItemTransactions

//
Transactions covering all movements of all stock items

Created: Modified:

Columns

  • //
    ${escapify(column.description)}
    StockItemTransactionID
    [int] NOT NULL DEFAULT (NEXT VALUE FOR [Sequences].[TransactionID])
  • //
    ${escapify(column.description)}
    StockItemID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    TransactionTypeID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    CustomerID
    [int] NULL
  • //
    ${escapify(column.description)}
    InvoiceID
    [int] NULL
  • //
    ${escapify(column.description)}
    SupplierID
    [int] NULL
  • //
    ${escapify(column.description)}
    PurchaseOrderID
    [int] NULL
  • //
    ${escapify(column.description)}
    TransactionOccurredWhen
    [datetime2](8) NOT NULL
  • //
    ${escapify(column.description)}
    Quantity
    [decimal](18, 3) NOT NULL
  • LastEditedBy
    [int] NOT NULL
  • LastEditedWhen
    [datetime2](8) NOT NULL DEFAULT (sysdatetime())

Indexes

  • CCX_Warehouse_StockItemTransactions
    CLUSTERED COLUMNSTORE
    StockItemTransactionID , StockItemID , TransactionTypeID , CustomerID , InvoiceID , SupplierID , PurchaseOrderID , TransactionOccurredWhen , Quantity , LastEditedBy , LastEditedWhen
  • //
    Auto-created to support a foreign key
    FK_Warehouse_StockItemTransactions_StockItemID
    NONCLUSTERED
    StockItemID
  • //
    Auto-created to support a foreign key
    FK_Warehouse_StockItemTransactions_TransactionTypeID
    NONCLUSTERED
    TransactionTypeID
  • //
    Auto-created to support a foreign key
    FK_Warehouse_StockItemTransactions_CustomerID
    NONCLUSTERED
    CustomerID
  • //
    Auto-created to support a foreign key
    FK_Warehouse_StockItemTransactions_InvoiceID
    NONCLUSTERED
    InvoiceID
  • //
    Auto-created to support a foreign key
    FK_Warehouse_StockItemTransactions_SupplierID
    NONCLUSTERED
    SupplierID
  • //
    Auto-created to support a foreign key
    FK_Warehouse_StockItemTransactions_PurchaseOrderID
    NONCLUSTERED
    PurchaseOrderID
  • PK_Warehouse_StockItemTransactions
    UNIQUE NONCLUSTERED
    StockItemTransactionID

Foreign Keys

  • FK_Warehouse_StockItemTransactions_Application_People
    Application.People
    LastEditedBy ⥱ PersonID
  • FK_Warehouse_StockItemTransactions_CustomerID_Sales_Customers
    Sales.Customers
    CustomerID ⥱ CustomerID
  • FK_Warehouse_StockItemTransactions_InvoiceID_Sales_Invoices
    Sales.Invoices
    InvoiceID ⥱ InvoiceID
  • FK_Warehouse_StockItemTransactions_PurchaseOrderID_Purchasing_PurchaseOrders
    Purchasing.PurchaseOrders
    PurchaseOrderID ⥱ PurchaseOrderID
  • FK_Warehouse_StockItemTransactions_StockItemID_Warehouse_StockItems
    Warehouse.StockItems
    StockItemID ⥱ StockItemID
  • FK_Warehouse_StockItemTransactions_SupplierID_Purchasing_Suppliers
    Purchasing.Suppliers
    SupplierID ⥱ SupplierID
  • FK_Warehouse_StockItemTransactions_TransactionTypeID_Application_TransactionTypes
    Application.TransactionTypes
    TransactionTypeID ⥱ 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