TODO
Source Area Generate Table
Section titled “Source Area Generate Table”Purpose
Section titled “Purpose”This code-generation template creates table creation scripts for Sql Server, exactly as per the defintion of the data object.
Motivation
Section titled “Motivation”After importing data definitions from operational systems, a typical next step is generating source objects to load the data delta into. This template creates these tables. This template can also be used to generate data solution objects like for like.
Applicability
Section titled “Applicability”- SQL Server family databases
Design Pattern
Section titled “Design Pattern”Schema Type
Section titled “Schema Type”Output Type
Section titled “Output Type”Implementation guidelines
Section titled “Implementation guidelines”This template can be assigned to any data object definition.
Considerations and consequences
Section titled “Considerations and consequences”[!NOTE] Exactly the same structure is used as is defined in the data object definition. E.g. no standard data solution or framework columns are added.
Extensions
Section titled “Extensions”N/A.
---- Source table creation statement for [{{lookupExtension dataConnection.extensions "datastore"}}].[{{lookupExtension dataConnection.extensions "location"}}].[{{name}}].---- Generated from template '{{templateMetadata.name}}'.--
DROP TABLE IF EXISTS [{{lookupExtension dataConnection.extensions "datastore"}}].[{{lookupExtension dataConnection.extensions "location"}}].[{{name}}];
CREATE TABLE [{{lookupExtension dataConnection.extensions "datastore"}}].[{{lookupExtension dataConnection.extensions "location"}}].[{{name}}]({{#each dataItems}} [{{name}}] {{stringupper dataType}}{{#if characterLength}}({{characterLength}}){{/if}}{{#if numericPrecision}}({{numericPrecision}},{{numericScale}}){{/if}},{{/each}} CONSTRAINT [PK_{{name}}] PRIMARY KEY CLUSTERED ( {{#each ./dataItemsMetadata.keyDataItems}} [{{stringupper @value}}]{{#unless @last}},{{/unless}} {{/each}} ));