Integration.GetLineageKey
Documentation | WideWorldImportersDW |
Schema | Integration |
Name | GetLineageKey |
Helper procedures for the ETL package
Input/Output
Mode | Name | Data type | Description | |
---|---|---|---|---|
1 | IN | TableName | nvarchar(128) | |
2 | IN | NewCutoffTime | datetime2(7) |
Script
CREATE PROCEDURE Integration.GetLineageKey @TableName sysname, @NewCutoffTime datetime2(7) WITH EXECUTE AS OWNER AS BEGIN SET NOCOUNT ON; SET XACT_ABORT ON; DECLARE @DataLoadStartedWhen datetime2(7) = SYSDATETIME(); INSERT Integration.Lineage ([Data Load Started], [Table Name], [Data Load Completed], [Was Successful], [Source System Cutoff Time]) VALUES (@DataLoadStartedWhen, @TableName, NULL, 0, @NewCutoffTime); SELECT TOP(1) [Lineage Key] AS LineageKey FROM Integration.Lineage WHERE [Table Name] = @TableName AND [Data Load Started] = @DataLoadStartedWhen ORDER BY LineageKey DESC; RETURN 0; END; |
Exported: 2019-02-04 23:05, Last imported: 2018-08-10 09:59