Hello,
I created multiple tables with the Outputtool in my Database.
In this example i created 3 tables.
But now i would like to set a primarykey for each of the tables.
i know that i can do it with Pre/Post-Create SQL statements but only for specific tables right? But how to do it for 50+ tables that i want to creat? https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Create-Database-Table-Primary-Key-i...
What would be the best way to automated creat those primarykeys for multiple tables after table creation in alteryx?
Cheers
David
Solved! Go to Solution.
Hi @df - I think I would convert the workflow to a Batch Macro so that each table gets created one by one. I would set up a control parameter that contains the create table statement and updates the PreSQL configuration with each loop. You would also want to change the Output Options to Append Existing as the table would get created in the PreSQL. A sample of what this might look like is below. Alternatively, you could update the PostSQL to assign the primary key after the table is written.