web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Insert Value into IDEN...
Power Automate
Answered

Insert Value into IDENTITY Column in SQL Server

(0) ShareShare
ReportReport
Posted on by 763 Super User 2024 Season 1

I have several tables in Azure SQL that have Identity Columns.  I am migrating data from another source that has an Id column. I want to retain the column definition of Identity for SQL but I want to insert the values from the source into that identity column. I have Set IDENTITY_INSERT to ON for the necessary tables. But when I try and setup the Flow using "Insert a row (v2)", it doesn't show the Identity column at all.

I tried recreating the table without IDENTITY, added the Insert into flow, which then showed the column, then dropped and created the table again with IDENTITY enabled.  Now flow still had the column I needed but when I executed the flow SQL returned the error IDENTITY_INSERT needs to be on, when it already was.

 

Any thoughts on how to do this? Dropping and recreating only works once, with the tables empty, any updates after that will not function.

 

Here is the exact error I am getting:

NOTE: IDENTITY_INSERT is ON for the table I am performing the insert on.

sperry1625_0-1644432861426.png

 

Thanks.

Categories:
I have the same question (0)
  • Verified answer
    sperry1625 Profile Picture
    763 Super User 2024 Season 1 on at

    I resolved this by creating a Stored Procedure that turns the IDENTITY_INSERT ON/OFF as needed to perform the updates.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard