Integration.GetMovementUpdates
Documentation | WideWorldImporters |
Schema | Integration |
Name | GetMovementUpdates |
Helper procedures for the ETL package
Input/Output
Mode | Name | Data type | Description | |
---|---|---|---|---|
1 | IN | LastCutoff | datetime2(7) | |
2 | IN | NewCutoff | datetime2(7) |
Script
CREATE PROCEDURE Integration.GetMovementUpdates @LastCutoff datetime2(7), @NewCutoff datetime2(7) WITH EXECUTE AS OWNER AS BEGIN SET NOCOUNT ON; SET XACT_ABORT ON; SELECT CAST(sit.TransactionOccurredWhen AS date) AS [Date Key], sit.StockItemTransactionID AS [WWI Stock Item Transaction ID], sit.InvoiceID AS [WWI Invoice ID], sit.PurchaseOrderID AS [WWI Purchase Order ID], CAST(sit.Quantity AS int) AS Quantity, sit.StockItemID AS [WWI Stock Item ID], sit.CustomerID AS [WWI Customer ID], sit.SupplierID AS [WWI Supplier ID], sit.TransactionTypeID AS [WWI Transaction Type ID], sit.TransactionOccurredWhen AS [Transaction Occurred When] FROM Warehouse.StockItemTransactions AS sit WHERE sit.LastEditedWhen > @LastCutoff AND sit.LastEditedWhen <= @NewCutoff ORDER BY sit.StockItemTransactionID; RETURN 0; END; |
Exported: 2019-02-04 23:04, Last imported: 2018-08-10 09:51