cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lesotho72
New Member

Getting err 'The key didn't match any rows in the table' when running stored proc on-prem SQL Server

Hello,

 

We have an on-premise SQL Server 2012 SP3 database which has an insert stored proc which we are trying to run from Flow.
When we run the stored proc we get error 'The key didn't match any rows in the table'.

There are unique keys which are autogenerated and work properly.  We have tested and used this stored proc hundreds of times outside of flow.

The permissions to access SQL Server appear to be ok as we have gone into SQL Profiler and confirmed Flow is hitting the db. We can see activity going against Sys tables to get the param info on stored procs.

We have also created a second, simpler stored proc with no parameters (just to test the params are not the issue) and that is getting the same error message.


We'd really like to use PowerApps and Flow with our on-prem SQL Server but there are constant roadblocks: cannot do inserts against views, can't have auto inserts/updates/deletes against tables with triggers so need to use stored procs. Now trying to use stored procs and getting errors. Hope someone can help!


Any help sincerely appreciated.

 

 

Thanks,

Dan

9 REPLIES 9
v-yuazh-msft
Community Support
Community Support

Hi @lesotho72,

 

Could you please share a screenshot of the configuration of your flow?

Could you please share more details about your requirement and the issue?

 

Please share more details so we would try to provide a proper workaround for you.

 

Best regards,

Alice

Hi Alice,

Thanks for your response.  More details:
(1) Our goal is to use PowerApps to write data to an On-Premise SQL Server database.  Leveraging Gateway to accomplish this.  Would prefer to just use PowerApps to do this but read that you cannot have a table with a trigger automatically work with insert/updates/deletes in PowerApps.  So, the workaround (that we read about) is to use Flow to run an insert stored proc.

(2) Technical screenshots including Gateway, Flow and error message are displayed below.

 FlowIssues.PNG

 

Thanks,
Dan

GabrielStJohn
Microsoft
Microsoft

Hello, @lesotho72!

Thank you for posting a reply to a topic on the Microsoft Flow Community! It appears that the users who you have been engaging in this thread with are now awaiting your reply! Please follow-up on this thread ASAP.

Thank You!

-Gabriel

Microsoft Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



@v-yuazh-msft - Please see my response with more details above.  Apologies for not tagging you in that post for review.

Please let me know if additional details are required.

 

Thanks,

Dan

Ranjani
Microsoft
Microsoft

I m getting same error while running SQL on premise ,Storeprocedure in microsoft flow . can you please share the solution 

 

 

 

GabrielStJohn
Microsoft
Microsoft

Hello, @v-yuazh-msft!

Thank you for posting a reply to a topic on the Microsoft Flow Community! It appears that the users who you have been engaging in this thread with are now awaiting your reply! Please follow-up on this thread ASAP.

Thank You!

-Gabriel

Microsoft Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



I take it this issue from 10-22-2018 still has not been solved. I have same issue myself. Any suggestions would be most welcome.

MukeshBhatt
Regular Visitor

Hello lesotho72

did you get any solution of this issue?

If yes. Can you please share the solution.

 

I am also getting the same kind of error while using Store procedure in Microsoft flow to get the data in the flow.
 I have tried to put manually the stored procedure name in the store procedure name and test the flow till that step flow working fine.

But in the next step where I grab the output of this stored procedure flow 'Execute stored procedure (V2)' flow not displaying output columns list in dynamic content. I am getting Returncode and I am not sure how to use this or is this correct way works the store procedure in Microsoft workflow.

I have attached the screenshot of the same as well. 

 

sp_Execute.jpg




Ranjani

stapes 

 

Any help sincerely appreciated.
 

Regards,
Mukesh

db1989
Advocate II
Advocate II

@Mukesh @lesotho72 

Check that you have correct connection selected. It fixed my error.

db1989_0-1605814327328.png

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,338)