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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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