Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

adding latest free number for primary key into DB

Genty
7 - Meteor

Hi, all I suspect this is a simple one but I can't seem to figure it out.

 

I am using a simple flow to update a table in a SQL database, I want to add a primary key in the flow but want it to choose the latest free number, for example I think I have around 840 rows of data, how can I make it automatically pick 841 as the next primary number to upload when next run? 

 

 

3 REPLIES 3
messi007
15 - Aurora
15 - Aurora

I'm replying to keep trucking the case maybe  I'll face sema problem one day.

 

Regards,

Maskell_Rascal
13 - Pulsar

Hi @Genty 

 

I think this might work for you. I'm essentially just finding the max primary key from my database, appending it onto my workflow, and then adding this number to my primary key. This gives me a dynamic method of always updating to the next number in the sequence. 

 

Maskell_Rascal_0-1610739436178.png

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Thanks!

Phil

Genty
7 - Meteor

Perfect and simple, clearly I was overthinking it again. Thanks

Labels