Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

How to connect external sql server in dataflow?

I would like to make a dataflow which retrieve data from external (No Azure) sql server and create records in dataverse. But I cannot connect the sql server and got error "An exception occurred: DataSource.Error: Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

 

How I tried is as follow:

 

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi 


Where is the SQL Server database located? If it is on an on-premises server/computer or in a VM, you need to configure an on-premises data gateway to query data from the database. An on-premises data gateway is used to connect your cloud services to on-premises data sources. 

What is an on-premises data gateway? - Power Apps | Microsoft Learn

Manage an on-premises data gateway in Power Apps - Power Apps | Microsoft Learn

 

In addition, the error message indicates that you cannot connect to the database server. You can use PowerShell Test-NetConnection command to test whether the server and port can be connected from your computer successfully. For example,

Test-NetConnection -ComputerName xx.xx.xx.xx -Port xx 

 

If you cannot connect to the server and port, you could refer to Lesson 2: Connecting from Another Computer - SQL Server | Microsoft Learn to check whether the database server allows the remote connection. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Hi @Syndicate_Admin 

 

I have tested as you said. It replies success.

 

TcpTestSucceeded : True

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors