Showing results for 
Search instead for 
Did you mean: 

Support 'Execute a SQL query' action through an on-premises data gateway

The “Execute a SQL query” action is not currently supported in Microsoft Flow using an on-premises gateway connection. 


The "Get rows" action allows users to pull records from a single table, but there is currently no way to pull records from multiple on-prem SQL tables. To avoid executing a complex query from Flow, some users have combined "Execute a stored procedure" to build a single table with "Get rows" to query it, but this workflow is also not supported with an on-premises data gateway.


Adding this functionality would create a great deal of opportunities for automation of testing and reporting on complex data structures.

Executing a Flow with this connector yields the following error:
  "message""Gateway ExecutePassThroughNativeQueryAsync\r\nclientRequestId: 0a3e8a93-45a6-4f29-ad28-d4375b6963a7",


 Flow Error.PNG


Status: Completed
Not applicable

I'll be running into the same obstruction. I'd like to create a PowerApp to pull data from a few related tables in a Point Of Sale database. The access has to be on-premises, and the security is such that I can't execute anything but read-only queries--even creating a stored procedure is out.

Kudo Collector

I'd like to see this feature supported in the PostgreSQL Connector. It should be expected that data in a relational database will need to be joined to be useful. Getting rows from one table will often require iterative queries inside loops - causing extreme increase in runtime.

New Member

Has anyone seen this? "Gateway GetPassThroughNativeQueryMetadataAsync - this operation (Get Native Sql Metadata) is currently not supported using an on-prem gateway connection clientRequestid: F8CBC37B-2699-4873-8909-8869C84F7A4A.


Read in another thread that this was "not supported yet" 

Regular Visitor

We are in the same boat as @Anonymous where we have an on-premises SQL Server hosting the database for a third-party product and we do not have write-permission to that server. We cannot create views or stored procedures for the data we need to see, we can only create SQL Select queries to pull the data we need. So without the ability to create SQL queries using an on-premises data gateway, we are stuck. 

Super User

Hi guys.


Any news on what the plan or due date for this is ? This would hugely help a few of our projects.


I want to Use Execute a sql query options in sql connectors in flows. can anyone help on this?

Super User

Hi @Ranjani


This works extremely well if you are using Azure SQL, but it does not work for on premises SQL servers that is accesses through the data gateway.


Let me know if you don't come right, or what you are struggling with.


I am using on premises SQL servers  only. any update on that?

Regular Visitor

This should have been done long ago. People have been asking for this for years at your conferences. Adding this feature should be a "must do".

Frequent Visitor
Still no update for this ???