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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Getting err 'The key d...
Power Automate
Unanswered

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

(1) ShareShare
ReportReport
Posted on by 10

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

Categories:
I have the same question (0)
  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    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

  • lesotho72 Profile Picture
    10 on at

    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 Profile Picture
    Microsoft Employee on at

    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

  • lesotho72 Profile Picture
    10 on at

    @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 Profile Picture
    Microsoft Employee on at

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

     

     

     

  • GabrielStJohn Profile Picture
    Microsoft Employee on at

    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

  • stapes Profile Picture
    894 on at

    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 Profile Picture
    2 on at

    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 Profile Picture
    30 on at

    @Mukesh @lesotho72 

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

    db1989_0-1605814327328.png

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard