Power Query Problems

Fix Excel Power Query SQL Server Pre-Login Handshake Timeouts

Muhammad TalhaMuhammad Talha Nov 22, 2026 868 views

Question details

Resolve a pre-login handshake timeout when Excel Power Query connects to a database that is reachable through SQL tools.

Fix Excel Power Query SQL Server Pre-Login Handshake Timeouts
Product
Microsoft Excel Power Query and SQL Server
Device & OS
not provided
Scenario
A user connects to a SQL Server database through Excel Power Query after successfully connecting through a SQL tool.
Observed behavior
The Power Query connection fails during the pre-login handshake, even though a SQL tool can connect to the database.
Before you start

Record the exact error message and compare the server name, port, authentication method, and encryption settings used by Excel and the working SQL tool. If possible, run both tests from the same device and network.

Solution 1Recommended

Compare the SQL Server connection and security settings

Use this approach first when a SQL tool connects successfully but Excel Power Query does not.

1
Check the Power Query source

In Excel, open Data > Queries & Connections, right-click the affected query, and select Edit. In Power Query Editor, review the Source step and confirm the server and database match the working SQL tool.

2
Review source permissions

In Excel, open Data > Get Data > Data Source Settings. Select the SQL Server source and review its permissions and credentials; update them if they differ from the intended connection.

3
Compare encryption and network access

In the SQL tool's connection settings, note the server address, port, encryption, and certificate settings. Ask the database administrator to verify that Excel's connection can reach the same endpoint and that the server's TLS configuration and certificate are valid.

4
Check server-side diagnostics

Ask the SQL Server administrator to review SQL Server and system logs for the time of the failed attempt. Include the exact Excel error and the results of the comparison with the working SQL tool.

Compare the SQL Server connection and security settings
Keep encryption secure: Do not disable encryption or bypass certificate validation as a permanent fix. Work with the administrator to correct certificate or TLS configuration issues.
Free Microsoft Office alternative

Work with Excel Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and compatibility with Microsoft Excel formats for easier migration. It does not repair Excel Power Query or SQL Server handshake errors.

Open and edit Microsoft Excel XLSX and XLS filesWork with spreadsheet data in a familiar interfaceUse a lightweight office suite with a free versionMove existing Office documents into an alternative workflow
microsoft office alternative - wps office

Frequently Asked Questions

Why can my SQL tool connect when Excel Power Query cannot?

The applications may use different server names, ports, drivers, credentials, or encryption settings. Compare the SQL tool's connection settings with the Source step in Power Query Editor and test from the same device and network.

Will increasing CommandTimeout fix a pre-login handshake error?

Usually not by itself. CommandTimeout controls query execution after a connection is established. For a pre-login failure, investigate connection timeout, network access, TLS, and server-side logs.

Where can I check the Power Query connection settings?

In Excel, open Data > Queries & Connections, right-click the query, and select Edit. Inspect the Source step or open Home > Advanced Editor to review the Sql.Database options.

Should I set the SQL command timeout to zero?

In custom SQL application code, SqlCommand.CommandTimeout = 0 means no command timeout. Use it only when the workload warrants an unlimited wait, and do not treat it as a fix for a pre-login handshake failure.