Feb 10 2022 07:51 AM
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 resultset, that column gets added to the end of the range.
Moving the column then affects the formatting, etc..
Is it possible to define the mapping so that new columns can be inserted into the existing sheet and those new columns in the resultset mapping properly?
So, if I return fields FieldA, FieldB, FieldC...
The excel sheet will show fields FieldA, FieldB, FieldC in that order.
If I add a field such that the result set looks like FieldA, FieldNEW, FieldB, FieldC...
The excel sheet currently shows fields FieldA, FieldB, FieldC, FieldNEW.
I want FieldNEW to show as the second column.
Thank you,
- Nick
Feb 10 2022 11:51 PM
actually it is the default behaviour that the output columns are in the same order as the input columns.
I suspect that you have somewhere in the query a step "Reordered Columns"
If that's the case, than this is the cause for the behaviour you describe. Just delete that step, if appropriate.
Feb 11 2022 04:18 AM
Feb 13 2022 11:57 PM
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.