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 / Unable to execute "Exe...
Power Automate
Unanswered

Unable to execute "Execute SQL Query (V2)" action in Power Automate

(1) ShareShare
ReportReport
Posted on by 6

Hi,

 

I am able to connect to my SQL Server using On Premise gateway connector in Power Automate(MS Flow).#sqlserver #MSFlow

But when I try to execute action "Execute SQL Query (V2)" from SQL server connector to run simple query "EXEC * from TableName" shows error "Gateway GetPassThroughNativeQueryMetadataAsync - this operation (Get Native Sql Metadata) is currently not supported using an on-prem gateway connection".

 

Please see the below screenshot:

 

Issue.png

Categories:
I have the same question (4)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Ankita2020 

     

    Yes that's correct. Unfortunately Execute a SQL query not supported an on-prem gateway connection.

     

    You can post this as an idea for future release.

     

    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas

     

    Thanks

  • dereka Profile Picture
    2 on at

    I just started using Flow and ran into this issue. Is there a work around? 

    Flow lets me click ellipse and add data gateway and error goes away...but then I get error when I run it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, facing same issue. It's frustrating that there is no guideline on how to make it work.

  • mevargasc Profile Picture
    14 on at

    If somebody is looking for this , I resolved with the "transform data query editor" action . In my case I needed a parameter , if you need create any and get from the previous action .

     

    mevargasc_0-1629921503244.png

     

    mevargasc_1-1629921698004.png

     

     

     

     

     

  • Automater Profile Picture
    13 on at

    This is probably one of the biggest use-cases in my opinion for custom logic especially where more than one table is involved in a query, and I keep hearing Power Query as a solution to this, however I have not found a clear enough example yet...

  • AymKdn Profile Picture
    10 on at

    After searching everywhere and trying multiple things, I finally found how to proceed.

     

    I posted everything you need to know on my blog: https://blog.kodono.info/wordpress/2022/12/09/power-automate-execute-a-sql-query-via-on-promise-gateway/

  • mevargasc Profile Picture
    14 on at

    Nowadays I see two ways for to do this :

    1.- Having cloud sql server and using azure authentication

    2.- Using power automate desktop and mix with power automate cloud for other actions. (I did already)

  • anila-lala Profile Picture
    33 on at

    As some other responses mentioned it already, I also overcome it by using the other action instead "Transform data using Power Query" and convert the SQL query to a Power Query which can be done in PowerBI. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 816

#2
Valantis Profile Picture

Valantis 603

#3
Haque Profile Picture

Haque 566

Last 30 days Overall leaderboard