Problem with SSIS package

Naomi Nosonovsky 8,791 Reputation points
2025-10-30T21:32:08.5966667+00:00

Hi everybody,

Looks like I ask a lot of questions lately :)

I have a SSIS package that shows the following metadata:

enter image description here

The package looks like this:

enter image description here

The output file is configured like this in Advanced Editor:

enter image description here

However, in preview mode it shows:

enter image description here

As you can see, the columns listed in the wrong order.

The preview shows : User's image

And the source shows

User's image

What can I do to correct this without re-doing the output?

SQL Server Integration Services
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Lakshmi Narayana Garikapati 555 Reputation points Microsoft External Staff Moderator
    2025-10-31T10:39:28.6066667+00:00

    Hi @Naomi Nosonovsky,

    SSIS caches metadata when you first configure the OLE DB Source. If the column order in WITH RESULT SETS differs from what SSIS expects (or if you edited the query later), SSIS may misalign columns in preview and downstream components.

    workaround

    • Open the OLE DB Source Editor.

    Click Preview — this confirms the query runs correctly.

     Click OK to close the editor.  Now right-click the OLE DB Source in the Data Flow and choose Advanced Editor.

     Go to the Input and Output Properties tab.

     Under OLE DB Source Output → Output Columns, manually reorder the columns to match the order in your WITH RESULT SETS clause.

    • You can rename or adjust the column order here without affecting the underlying query.
    •  not to change data types unless necessary.

    Thanks.

    Lakshmi.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.