ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

adding latest free number for primary key into DB

Genty
メテオール

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件の返信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
パルサー

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
メテオール

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

ラベル
トップのソリューション投稿者