Keep Excel Notes Attached to SQL Data Rows After Refresh
Question details
Keep manually entered notes associated with the correct SQL Server records when imported data is refreshed.

- 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.
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.
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.
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.
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.
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.
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.
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.

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.

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.




