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

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 I
Helper I

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

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,409)