Forum Discussion
copco_online
Feb 10, 2022Copper Contributor
Mapping Stored Procedure Query Results to Excel Worksheet Columns
I have an Excel Workbook where for each sheet I load data from a stored procedure. The worksheet refreshes the data in the order of the procedure. However, if I insert a column into the procedure's ...
copco_online
Feb 11, 2022Copper Contributor
Hello DTE,
Thank you for the response. I'm not sure if there is a "step" called "Reordered Columns". The source is a stored procedure, and the query cannot be shown graphically within Excel. Is it possible that I'm just not seeing where this is? It seems to me that some sort of mapping is established at the onset when the query definition is constructed. When a field is added in the output of the stored procedure where we would like it, Excel not knowing or recognizing the mapping simply puts it at the end. Where should I look for this Reordered Columns step? Thanks.
Thank you for the response. I'm not sure if there is a "step" called "Reordered Columns". The source is a stored procedure, and the query cannot be shown graphically within Excel. Is it possible that I'm just not seeing where this is? It seems to me that some sort of mapping is established at the onset when the query definition is constructed. When a field is added in the output of the stored procedure where we would like it, Excel not knowing or recognizing the mapping simply puts it at the end. Where should I look for this Reordered Columns step? Thanks.
Martin_Weiss
Feb 14, 2022Bronze Contributor
Hi copco_online ,
if it's an external stored procedure, then it might be difficult. But maybe you could try the following:
Open the Queries & Connections pane and check, if there is a connection listed there. If so, you could do a right-click on it and theck the properties.
If you are lucky, there is a connection string where you can see a SQL statement.
This could be the place where the sort order of the fields are defined.
But there is also a good chance that you do not find anything here. Unfortunately inn this case, I do not have any further advise for you.