Data Import & Export

Keep Excel Notes Attached to SQL Data Rows After Refresh

Aamir Naveed AkramAamir Naveed Akram Nov 22, 2026 868 views

Question details

Keep manually entered notes associated with the correct SQL Server records when imported data is refreshed.

Keep Excel Notes Attached to SQL Data Rows After Refresh
Product
Microsoft Excel and SQL Server
Device & OS
not provided
Scenario
A user adds a Notes column alongside data imported from SQL Server and then refreshes the data.
Observed behavior
When source rows change or are reordered, the manually added notes can become associated with the wrong records.
Before you start

Identify a stable, unique record ID in the SQL data and use it to match each existing note to its record. Check that the ID values use the same data type in both the SQL query and the notes table.

Solution 1Recommended

Merge a separate notes table into the SQL query

Use a stable record ID to match notes to SQL records, regardless of row order during refresh.

Keep the notes in a separate input table, not in the refreshed query output. Each record ID should appear only once in the notes table to avoid duplicate rows when the queries are merged.

1
Create a notes table

On a separate worksheet, enter the record IDs and their corresponding notes in two columns. Select the range and choose Insert > Table, then give the table a recognizable name such as NotesInput.

2
Create a query for the notes

Select a cell in NotesInput and choose Data > From Table/Range. In Power Query, confirm the ID column has the same data type as the SQL query's ID column, then choose Close & Load To and create a connection only.

3
Merge the queries

Open the SQL query from Data > Queries & Connections. In Power Query, choose Home > Merge Queries, select the notes query, and select the record ID column in each table. Choose a Left Outer join to retain all SQL records.

4
Expand and load the notes

Select the expand button on the merged column, choose the Notes field, and select OK. Choose Home > Close & Load to load the merged results into Excel.

5
Edit notes and refresh

Add or change notes in the separate NotesInput table, then select Data > Refresh All. Check that the merged output shows each note beside its matching record ID.

Merge a separate notes table into the SQL query
Do not edit notes in the query output: Changes made directly in the refreshed output are not a reliable way to store notes. You can also store notes in SQL Server and join them by record ID, if you have permission to modify the database.
Free Microsoft Office alternative

Review and Edit Spreadsheets with WPS Office

WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface for working with existing workbooks. Open compatible Excel files for a convenient transition, while continuing to use Excel for the SQL refresh and Power Query merge described above.

Review record IDs and notes in a familiar spreadsheet interfaceOpen and edit Microsoft Excel XLSX filesUse a free, lightweight Office suiteMove between compatible Office documents with a familiar layout
microsoft office alternative - wps office

Frequently Asked Questions

Why do my notes move to the wrong SQL records after refresh?

A manually added column is not necessarily part of the SQL query, so its values may stay in worksheet positions while refreshed records change order. Match notes by a stable record ID instead of row position.

What happens if a SQL record has no matching note?

With a Left Outer join in Power Query, the SQL record remains in the output and its expanded Notes value is blank or null.

Where should I enter new notes after setting up the merge?

Enter them in the separate NotesInput table alongside the correct record IDs, then choose Data > Refresh All to update the merged output.

Can I store the notes in SQL Server instead?

Yes. If you have database permission, store notes in the source database or a separate table keyed by record ID, then join them in the SQL query. This keeps the notes in the data returned on refresh.