Hi
I'm using the same flow for several different sources.
For all of them I wanna define the source and use this to create my sql table:
But I also wanna define a primary key, and the only way I found is this. But can the post create sql statement use a formula field?
ALTER TABLE UNIFY_DK_CONSOLIDATED <-- replased with formla field?
ALTER COLUMN ID int NOT NULL;
ALTER TABLE UNIFY_DK_CONSOLIDATED
ADD PRIMARY KEY (ID);
Hi @Hamder83 ,
The easiest way to do this is to put the output tool in a macro and feed the SQL script in as a control parameter. This control parameter can connect to eh output tool in the macro with the Action tool updating the value in the Post SQL Script field, or the specific variable within the script.
So, you could create the dynamic variable, in this example "UNIFY_DK_CONSOLIDATED " as a formula, take a sum of this grouping by this field and feeding in as the control parameter. In your script, change this value to be XXXXX and have the action tool overwrite that value.
This means you can dynamically create the SQL script.
Hope this helps.
M.
Here's an illustration for how it would work with Pre - Post would be the tactic.