Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

duplicate key value in SQL

(0) ShareShare
ReportReport
Posted on by 4

Hi All,


I am currently working on a flow that writes data from 7 different forms (MSForms) into a SQL database.


I am currently receiving an error message: Violation of PRIMARY KEY constraint 'dbo.MY_DB'. Cannot insert duplicate key in object 'dbo.MY_DB'. The duplicate key value is (5).

This happens because I have multiple forms running in the same table in my SQL DB. Since each form has a separate form ID, this causes problems in the SQL DB afterwards. e.g. Id 3 from Form1 and Id 3 from Form7.

 

Now my question: Is there a way that the form ID's (primarykeys) are always incremented so all the id's of all forms are always unique?

 

Thanks in advance and best regards

 

  • PrasadAthalye Profile Picture
    on at
    Re: duplicate key value in SQL

    @WFCH - Do you have any update if you manage to alter key?

  • PrasadAthalye Profile Picture
    on at
    Re: duplicate key value in SQL

    @WFCH - Did you get chance to alter Key and see if it works?

  • PrasadAthalye Profile Picture
    on at
    Re: duplicate key value in SQL

    Yes that is what I recommend.

  • WFCH Profile Picture
    4 on at
    Re: duplicate key value in SQL

    Hello Prasad,

     

    Thanks for your reply.

     

    And how exactly would I do this? Does this mean i should connect Form ID with the Form Responce ID and make them together one primary key?

  • PrasadAthalye Profile Picture
    on at
    Re: duplicate key value in SQL

    Form Response ID across different forms wont be unique.  You will have first response Id as 1 in every form. But Form ID which is a GUID will be different.  You can Append Form ID with Form Response ID and then make that as a Primary Key. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1