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.
Thanks.
I resolved this by creating a Stored Procedure that turns the IDENTITY_INSERT ON/OFF as needed to perform the updates.