You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Hub Insert Into statement for {{targetDataObject.name}}
4
-
-- Generated at {{now}}
4
+
--
5
+
-- This template inserts the data delta that has been detected by comparing the Hub View to the existing Hub data into the target Hub table.
5
6
--
6
7
7
-
INSERT INTO [{{targetDataObject.name}}]
8
+
INSERT INTO [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}]
FROM [{{sourceDataObjects.0.dataObjectConnection.extensions.0.value}}].[{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] hub_view
FROM [{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] hub_view
23
+
LEFT OUTER JOIN [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}] hub_table
24
24
ON hub_view.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}] = hub_table.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}]
25
25
WHERE hub_table.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}] IS NULL
Copy file name to clipboardExpand all lines: Virtual_EDW/Templates/templateHubInsertIntoDirectWrapper.Handlebars
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@
2
2
GO
3
3
--
4
4
-- Hub ETL procedure for {{targetDataObject.name}}, coming from {{sourceDataObjects.0.name}}
5
-
-- Generated at {{now}}
6
5
--
7
6
8
7
CREATE OR ALTER PROCEDURE [usp_{{targetDataObject.name}}_{{sourceDataObjects.0.name}}]
@@ -75,7 +74,7 @@ BEGIN
75
74
Main ETL block
76
75
*/
77
76
78
-
INSERT INTO [{{targetDataObject.name}}]
77
+
INSERT INTO [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}]
FROM [{{sourceDataObjects.0.dataObjectConnection.extensions.0.value}}].[{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] hub_view
93
-
LEFT OUTER JOIN [{{targetDataObject.name}}] hub_table
91
+
FROM [{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] hub_view
92
+
LEFT OUTER JOIN [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}] hub_table
94
93
ON hub_view.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}] = hub_table.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}]
95
94
WHERE hub_table.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}] IS NULL
Copy file name to clipboardExpand all lines: Virtual_EDW/Templates/templateLinkView.Handlebars
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
--
2
2
-- Link View definition for {{generationSpecificMetadata.selectedDataObject.name}}
3
-
-- Generated at {{generationSpecificMetadata.generationDateTime}}
4
3
--
5
4
6
5
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[{{metadataConfiguration.vdwSchemaName}}].[{{generationSpecificMetadata.selectedDataObject.name}}]') AND type in (N'V'))
@@ -17,7 +16,7 @@ SELECT
17
16
{{#eachdataItemMappings}} + ISNULL(RTRIM(CONVERT(NVARCHAR(100), [{{targetDataItem.name}}])), 'N/A') + '#~!'{{/each}}{{#eachbusinessKeys}}{{#if@first}} ) AS {{surrogateKey}},{{/if}}{{/each}}
18
17
-1 AS {{../metadataConfiguration.etlProcessAttribute}}, {{!-- List out the ETL Framework attributes --}}
19
18
MIN({{../metadataConfiguration.loadDateTimeAttribute}}) AS {{../metadataConfiguration.loadDateTimeAttribute}},
20
-
{{../metadataConfiguration.recordSourceAttribute}},{{#eachbusinessKeys}}{{#unless@first}}{{!-- List out the separate (Hub) business keys, by skipping the first generic relationship key. --}}
19
+
{{#eachbusinessKeys}}{{#unless@first}}{{!-- List out the separate (Hub) business keys, by skipping the first generic relationship key. --}}
Copy file name to clipboardExpand all lines: Virtual_EDW/Templates/templateSatelliteInsertInto.Handlebars
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,10 @@
2
2
--
3
3
-- Satellite Insert Into statement for {{targetDataObject.name}}
4
4
--
5
+
-- This template inserts the data delta that has been detected by comparing the Satellite View to the existing data into the target Satellite table.
6
+
--
5
7
6
-
INSERT INTO [{{targetDataObject.name}}]
8
+
INSERT INTO [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}]
FROM [{{sourceDataObjects.0.dataObjectConnection.extensions.0.value}}].[{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] sat_view
31
-
LEFT OUTER JOIN [{{targetDataObject.name}}] sat_table
32
+
FROM [{{../metadataConfiguration.vdwSchemaName}}].[{{targetDataObject.name}}] sat_view
33
+
LEFT OUTER JOIN [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{targetDataObject.dataObjectConnection.extensions.1.value}}].[{{targetDataObject.name}}] sat_table
32
34
ON sat_view.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}] = sat_table.[{{#eachbusinessKeys}}{{#if@first}}{{surrogateKey}}{{/if}}{{/each}}]
33
35
AND sat_view.[{{../metadataConfiguration.loadDateTimeAttribute}}] = sat_table.[{{../metadataConfiguration.loadDateTimeAttribute}}]
DATEADD(mcs,[{{../metadataConfiguration.sourceRowIdAttribute}}], {{../metadataConfiguration.loadDateTimeAttribute}}) AS {{../metadataConfiguration.loadDateTimeAttribute}},
19
+
) AS [{{surrogateKey}}],{{/each}}
20
+
--DATEADD(mcs,[{{../metadataConfiguration.sourceRowIdAttribute}}], {{../metadataConfiguration.loadDateTimeAttribute}}) AS {{../metadataConfiguration.loadDateTimeAttribute}},
) AS [{{../metadataConfiguration.recordChecksumAttribute}}],
50
51
{{#eachdataItemMappings}}
51
-
{{sourceDataItems.0.name}} AS {{targetDataItem.name}},
52
+
[{{targetDataItem.name}}],
52
53
{{/each}}
53
54
ROW_NUMBER() OVER (PARTITION BY {{#eachbusinessKeys}}{{#eachbusinessKeyComponentMapping}}{{!-- Create a row number to enable selection only the earliest row, ordered by date/time --}}
ORDER BY {{#eachbusinessKeys}}{{#eachbusinessKeyComponentMapping}}{{!-- Create a row number to enable selection only the earliest row, ordered by date/time --}}
ORDER BY [{{../metadataConfiguration.loadDateTimeAttribute}}] ASC, [{{../metadataConfiguration.eventDateTimeAttribute}}] ASC, [{{../metadataConfiguration.changeDataCaptureAttribute}}] DESC) = COMBINED_VALUE
79
80
THEN 'Same'
80
81
ELSE 'Different'
81
-
END AS VALUE_CHANGE_INDICATOR,
82
+
END AS [VALUE_CHANGE_INDICATOR],
82
83
CASE
83
84
WHEN LAG([{{../metadataConfiguration.changeDataCaptureAttribute}}],1,'') OVER (PARTITION BY {{#eachbusinessKeys}}{{#eachbusinessKeyComponentMapping}}
ORDER BY [{{../metadataConfiguration.loadDateTimeAttribute}}] ASC, [{{../metadataConfiguration.eventDateTimeAttribute}}] ASC, [{{../metadataConfiguration.changeDataCaptureAttribute}}] ASC) = [{{../metadataConfiguration.changeDataCaptureAttribute}}]
87
88
THEN 'Same'
88
89
ELSE 'Different'
89
-
END AS CDC_CHANGE_INDICATOR,
90
+
END AS [CDC_CHANGE_INDICATOR],
90
91
CASE
91
92
WHEN LEAD([{{../metadataConfiguration.loadDateTimeAttribute}}],1,'9999-12-31') OVER (PARTITION BY {{#eachbusinessKeys}}{{#eachbusinessKeyComponentMapping}}
ORDER BY [{{../metadataConfiguration.loadDateTimeAttribute}}] ASC, [{{../metadataConfiguration.eventDateTimeAttribute}}] ASC, [{{../metadataConfiguration.changeDataCaptureAttribute}}] ASC) = [{{../metadataConfiguration.loadDateTimeAttribute}}]
FROM [{{sourceDataObjects.0.dataObjectConnection.extensions.0.value}}].[{{sourceDataObjects.0.dataObjectConnection.extensions.1.value}}].[{{sourceDataObjects.0.name}}]
0 commit comments