Data Import & Export

Filter SQL Server Data Before Importing It into Excel

Adam DavisAdam Davis Nov 18, 2026 869 views

Question details

Retrieve only the required SQL Server records before loading them into an Excel worksheet.

Filter SQL Server Data Before Importing It into Excel
Product
Microsoft Excel Power Query and SQL Server
Device & OS
not provided
Scenario
A user needs to import a subset of a large SQL Server table into Excel.
Observed behavior
Importing the entire table can exceed Excel's worksheet row limit and cause Excel to become unresponsive.
Before you start

Have the SQL Server name, database name, connection credentials, and the columns or conditions needed to identify the records ready. Confirm that you have permission to read the relevant table.

Solution 1Recommended

Filter the SQL Server table in Power Query before loading

Use Power Query to select the needed rows and columns before sending the results to a worksheet.

When query folding is supported, Power Query can send filters back to SQL Server so the server returns fewer rows. Folding depends on the connector and the transformations applied.

1
Connect to SQL Server

In Excel, select Data > Get Data > From Database > From SQL Server Database. Enter the server and database details, then sign in if prompted.

2
Open the query editor

In Navigator, select the table and choose Transform Data rather than Load.

3
Filter and select columns

In Power Query Editor, use the filter arrow on the relevant column to set your conditions. Use Home > Choose Columns to keep only the fields you need.

4
Check query folding

In Applied Steps, right-click the filtering step and select View Native Query if it is available. Check whether the displayed SQL includes the intended filter; the command's availability varies.

5
Load the finished query

After reviewing the preview and filters, select Home > Close & Load To and choose where to place the results.

Filter the SQL Server table in Power Query before loading
Keep the worksheet limit in mind: An Excel worksheet has 1,048,576 rows, including any header row. If the filtered results still exceed the available rows, narrow the filter further or choose a different destination.
Free Microsoft Office alternative

Review Filtered SQL Server Exports in WPS Spreadsheet

WPS Office is a free, lightweight Microsoft Office alternative with a familiar interface. Export filtered SQL Server results to a spreadsheet-compatible file, then open them in WPS Spreadsheet for review and editing.

Open filtered SQL Server exports in CSV format for spreadsheet analysisCompatible with Microsoft Excel formats, including XLSX and XLSFamiliar spreadsheet interface supports an easier transition from Microsoft OfficeFree and lightweight for everyday document and spreadsheet work
microsoft office alternative - wps office

Frequently Asked Questions

How can I filter SQL Server data before it reaches the worksheet?

Choose Data > Get Data > From Database > From SQL Server Database, select Transform Data, and apply column filters in Power Query Editor before using Close & Load To.

Does a Power Query filter always run on SQL Server?

No. Query folding depends on the connector and the applied transformations. Right-click the filter in Applied Steps and check View Native Query when it is available.

Where can I enter a SQL query in Excel?

Open Data > Get Data > From Database > From SQL Server Database, expand Advanced options, and enter your SELECT statement in the SQL statement field.

What if the filtered data still exceeds Excel's row limit?

An Excel worksheet holds up to 1,048,576 rows, including any header. Add more restrictive conditions in Power Query or your SQL WHERE clause, or choose a destination that can accommodate the results.