mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
[refactored] changed to output clause
This commit is contained in:
+2
-6
@@ -13,15 +13,11 @@ BEGIN
|
||||
INSERT Integration.Lineage
|
||||
([Data Load Started], [Table Name], [Data Load Completed],
|
||||
[Was Successful], [Source System Cutoff Time])
|
||||
OUTPUT
|
||||
inserted.[Lineage Key] as LineageKey
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user