Skip to content

Commit 535fa5a

Browse files
authored
Merge pull request #690 from mrgchr/refactor/GetLineageKey
[refactored] changed to output clause
2 parents 80ed614 + 2d040e0 commit 535fa5a

File tree

1 file changed

+2
-6
lines changed
  • samples/databases/wide-world-importers/wwi-dw-ssdt/wwi-dw-ssdt/Integration/Stored Procedures

1 file changed

+2
-6
lines changed

samples/databases/wide-world-importers/wwi-dw-ssdt/wwi-dw-ssdt/Integration/Stored Procedures/GetLineageKey.sql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ BEGIN
1313
INSERT Integration.Lineage
1414
([Data Load Started], [Table Name], [Data Load Completed],
1515
[Was Successful], [Source System Cutoff Time])
16+
OUTPUT
17+
inserted.[Lineage Key] as LineageKey
1618
VALUES
1719
(@DataLoadStartedWhen, @TableName, NULL,
1820
0, @NewCutoffTime);
1921

20-
SELECT TOP(1) [Lineage Key] AS LineageKey
21-
FROM Integration.Lineage
22-
WHERE [Table Name] = @TableName
23-
AND [Data Load Started] = @DataLoadStartedWhen
24-
ORDER BY LineageKey DESC;
25-
2622
RETURN 0;
2723
END;

0 commit comments

Comments
 (0)