Search code examples
sqlexceldatatableexcel-external-data

Insert new columns to SQL query data table in Excel


I have a simple query in Excel table to pull various data from our SQL database. I tried to insert two new columns for entering new information(right click on the header -> insert) for each row of data (see screenshot below).

However, every time I "Refresh All" data, the value in the newly inserted columns (I and J) randomly moves to a different row.

Please advise if there's a way to fix this or other workarounds.

Thanks

enter image description here

  • Dates in Column13 & Column14 randomly moved

enter image description here


Solution

  • In the Data tab in excel, under 'Queries and Connections'. click on properties. In the window that opens, make sure that you select 'Overwrite existing cells with new data', instead of 'Insert cells for new data'. That solved my issue.