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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kvitnitskiy
Frequent Visitor

error: 40 - Could not open a connection to SQL Server

Hi all.

 have an issue with connection to SQL server.  and this  just start  happens recently. before it works perfect. 

 I can connect to server succesfully via MSSMS but not via Power BI, it the same time if I add tcp:  before server name  - it works. 

and I noticed this connection server doesn't  work for me from my PC, using another PC with my credentials - works fine, looks like something on my PC doesnt let Power BI connect,  any ideas? 

kvitnitskiy_0-1648835133363.png

p.s. Power BI  Version: 2.103.881.0 64-bit (March 2022), on previous version vas the same. 

 

2 REPLIES 2
kvitnitskiy
Frequent Visitor

check if the outbound traffic over port 1433 port is allowed - YEs, other(6) SQL  servers works perfect 
 add firewall rules to specify which IP address ranges - I dont have access for it. 

V-lianl-msft
Community Support
Community Support

Hi @kvitnitskiy ,

 

1. Please check if the outbound traffic over port 1433 port is allowed on the machine which has desktop runs.

2. Please add firewall rules to specify which IP address ranges from the Internet are allowed. See: Azure SQL Database server-level and database-level firewall rules.

3. Go to File Menu > Options and Settings > Data Source Setting then clear the permission for datasource. Then use servername,port as server in Power BI Desktop to connect to SQL database

 

You can also refer to these threads:

https://community.powerbi.com/t5/Power-Query/Failed-to-connect-to-SQL-Server/td-p/28939 

https://community.powerbi.com/t5/Desktop/Able-to-connect-to-database-using-SSMS-But-not-via-Power-BI... 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.