Skip to content

Commit 234aad7

Browse files
committed
Table creation templates for Links, Satellites.
1 parent 10ddff3 commit 234aad7

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed

Virtual_EDW/Templates/templateCollection.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,28 @@
256256
"TemplateNotes": "Creating DIRECT registration scripts."
257257
},
258258
{
259-
"TemplateName": "500 Data Vault Hub Generate Tables for DIRECT wrapper",
259+
"TemplateName": "500 Data Vault Hub Generate Tables",
260260
"TemplateType": "CoreBusinessConcept",
261261
"TemplateConnectionKey": "IntegrationConnectionInternalId",
262262
"TemplateOutputFileConvention": "{targetDataObject.name}.sql",
263263
"TemplateFilePath": "templateHubGenerateTables.handlebars",
264-
"TemplateNotes": "Creating tables using the DIRECT standard conventions."
264+
"TemplateNotes": "Creating tables for Core Business Concepts."
265+
},
266+
{
267+
"TemplateName": "500 Data Vault Link Generate Tables",
268+
"TemplateType": "NaturalBusinessRelationship",
269+
"TemplateConnectionKey": "IntegrationConnectionInternalId",
270+
"TemplateOutputFileConvention": "{targetDataObject.name}.sql",
271+
"TemplateFilePath": "templateLinkGenerateTables.handlebars",
272+
"TemplateNotes": "Creating tables for Natural Business Relationships."
273+
},
274+
{
275+
"TemplateName": "500 Data Vault Satellite Generate Tables",
276+
"TemplateType": "Context",
277+
"TemplateConnectionKey": "IntegrationConnectionInternalId",
278+
"TemplateOutputFileConvention": "{targetDataObject.name}.sql",
279+
"TemplateFilePath": "templateSatelliteGenerateTables.handlebars",
280+
"TemplateNotes": "Creating tables for Context tables."
265281
},
266282
{
267283
"TemplateName": "500 Data Vault Satellite Batch/Module Registration for DIRECT",
@@ -399,4 +415,4 @@
399415
"TemplateFilePath": "templatePersistentStaging.handlebars",
400416
"TemplateNotes": "This template expects a full copy of incoming data to be placed in a landing area, and performs a full outer join to detects data changes."
401417
}
402-
]
418+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{#each dataObjectMappings}}{{#if @first}}
2+
--
3+
-- Table creation statement for {{targetDataObject.name}}
4+
--
5+
6+
IF OBJECT_ID('[{{targetDataObject.name}}]', 'U') IS NOT NULL
7+
DROP TABLE [{{targetDataObject.name}}];
8+
9+
CREATE TABLE [{{targetDataObject.name}}]
10+
(
11+
[{{#each businessKeys}}{{#if @first}}{{surrogateKey}}{{/if}}{{/each}}] binary(16) NOT NULL
12+
,[{{../metadataConfiguration.etlProcessAttribute}}] [int] NOT NULL
13+
,[{{../metadataConfiguration.loadDateTimeAttribute}}] [datetime2](7) NOT NULL
14+
,[{{../metadataConfiguration.recordSourceAttribute}}] [nvarchar](100) NOT NULL
15+
{{#each relatedDataObjects}}
16+
,[{{name "LNK_", ""}}_SK] binary(16) NOT NULL
17+
{{/each}}
18+
){{/if}}{{/each}}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{#each dataObjectMappings}}{{#if @first}}
2+
--
3+
-- Table creation statement for {{targetDataObject.name}}
4+
--
5+
6+
IF OBJECT_ID('[{{targetDataObject.name}}]', 'U') IS NOT NULL
7+
DROP TABLE [{{targetDataObject.name}}];
8+
9+
CREATE TABLE [{{targetDataObject.name}}]
10+
(
11+
[{{#each businessKeys}}{{#if @first}}{{surrogateKey}}{{/if}}{{/each}}] binary(16) NOT NULL
12+
,[{{../metadataConfiguration.etlProcessAttribute}}] [int] NOT NULL
13+
,[{{../metadataConfiguration.loadDateTimeAttribute}}] [datetime2](7) NOT NULL
14+
,[{{../metadataConfiguration.recordSourceAttribute}}] [nvarchar](100) NOT NULL
15+
{{#each relatedDataObjects}}
16+
{{/each}}
17+
{{#each dataItemMappings}}
18+
,[{{targetDataItem.name}}] [nvarchar](1000) NOT NULL
19+
{{/each}}
20+
){{/if}}{{/each}}

0 commit comments

Comments
 (0)