Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Best way to run VB Script against SQL Server On prem using flow

Hi All,


I have a word file that uses VBscript to fetch Data from an on prem sql server db. With an on prem data gateway when I tried to use execute sql query action under SQL server within flow, it threw an error as shown below. I believe this is a limitation at this point. Having said that, can someone please share an alternative to run vbscript from power automate? May be via an azure function approach if its doable that way, thanks in advance. 



Super User
Super User

You cannot use a SQL Query via the on-prem gateway, this option is only valid for Azure based SQL servers. However you may be able to get the data you need by selecting a table and using an odata filter query.


You cannot run VBScript (or VBA) from a cloud flow, but you could do it with a Power Automate Desktop flow. But if all you need is some data from your SQL server, you should be able to do that quite easily within a cloud flow.

Thanks @Paulie78 , appreciate the answer. Would you please share an example or screenshot about the cloud flow option you mentioned, it would be very helpful to understand. Also, I am trying to get my hands on with Power Automate desktop but have not used so far, any help or direction there would be very helpful too just for knowledge purpose. 

Helper II
Helper II

Can someone please share a potential flow solution for this, thanks. 

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,739)