Power Query Problems

Join an Excel Table to SQL Server Data with Power Query

Olivia MillerOlivia Miller Nov 14, 2026 868 views

Question details

The user wants to join a small Excel worksheet table with a large SQL Server table using Power Query or Microsoft Query.

Can Power Query Join an Excel Table Directly to SQL Server?
Product
Microsoft Excel Power Query and SQL Server
Device & OS
not provided
Scenario
Combine workbook keys with matching records from a larger server table, ideally performing the join on SQL Server.
Observed behavior
A SQL query cannot reference an ordinary workbook table by name as though it were a SQL Server table.
Before you start

Confirm the join columns in Excel and SQL Server contain compatible values and data types. Check your SQL Server access and whether you have permission to create or load a staging table.

Solution 1Recommended

Load the Excel table into SQL Server for a server-side join

Use a staging table when the SQL Server table is large and you need the join to run on the server.

A workbook table is a separate data source, so it cannot be referenced by its workbook table name in an ordinary SQL Server query. Loading its rows into SQL Server makes both sides available for a server-side join.

1
Prepare the workbook table

In Excel, select the range and choose Insert > Table. Give the columns clear names, check the join key, and save the workbook.

2
Import the Excel rows

In SQL Server Management Studio, right-click the destination database and choose Tasks > Import Data. In the import wizard, select Microsoft Excel as the source and SQL Server as the destination, then map the worksheet columns to a staging table.

3
Run the join

Open New Query in SQL Server Management Studio and join the staging table to the server table on the matching key. To keep every Excel row, use the staging table on the left side of a LEFT JOIN.

4
Connect Excel to the result

In Excel, choose Data > Get Data > From Database > From SQL Server Database. Connect to the database and select the result through a view or a suitable SQL query.

Load the Excel table into SQL Server for a server-side join
Import requirements: The import wizard and a compatible Excel data provider must be available, and your account must have the required database permissions. Refresh the staging table when the workbook data changes.
Free Microsoft Office alternative

Work with Excel tables in WPS Office

WPS Office is a free, lightweight alternative for working with spreadsheets in a familiar interface. Its Microsoft Excel format compatibility helps you move existing workbooks into WPS, although it does not fix Microsoft Power Query or perform the SQL Server join described above.

Open and edit Excel-compatible XLSX and XLS filesReview and prepare workbook tables and join keysUse a familiar spreadsheet interface for a smoother transitionWork with a free, lightweight office suite
QA img-9

Frequently Asked Questions

Can SQL Server reference my Excel table by its workbook name?

Not in an ordinary SQL Server query: the workbook is a separate data source. You can load its rows into a staging table, or use Power Query to merge the two sources. SQL Server can access external files through separately configured mechanisms, but those are not the same as directly referencing a workbook table in Power Query.

How do I keep every Excel row in the merged result?

In Power Query Editor, select the Excel query first, choose Home > Merge Queries, and select Left Outer as the join kind. In SQL, put the Excel staging table on the left of a LEFT JOIN.

Will a Power Query merge always run on SQL Server?

No. A merge between an Excel table and SQL Server may be evaluated locally. Filters and other steps may fold depending on the connector and query, so check folding and test the refresh.

Could filtering SQL Server with Excel values be faster than a merge?

It may be worth testing a filter based on the workbook keys. Some IN-style filters may fold to SQL Server, but folding is not guaranteed and performance depends on the query and dataset.

What if the Excel and SQL join columns have different data types?

In Power Query Editor, select each key column and use the Data Type control to assign compatible types. For a SQL staging-table join, also check the destination column types and ensure the values are formatted consistently.