SSIS Error: "Meta data for: ... "does not match the metadata for the associated output column"

Peter Schmitz

Staff member
This morning, I found myself adding some new columns to an existing dataflow that uses a Union All to combine data from 4 different SQL sources. It had been set up so all SQL statements produce the same columns, and I added some default fields to accommodate for the sources that do not have the new columns using something like the following:

, 0 AS NewColumn1
, CAST(NULL AS nvarchar(max) AS NewColumn2

When then attempting to add the new columns to the Union All component, the error popped up:

The metadata for "Union.All.Inputs[Union All Input 5].Columns[NewColumn1]" does not atch the metadata for the associated output column.

Failed to set property "OutputColumnLineageID" on "Union All.Inputs[Union All Input.5[.Columns[NewColumn1]"

Apparently SSIS is pretty fickle, and you need to explicitly cast the columns to the proper datatype. I did do that with the nvarchar column, but as you can see, not with the bit column. This caused SSIS to cast it as DT_I4 (integer), rather than DT_BOOL.

You can verify the datatypes by double-clicking the line going from the source to the Union All component, and checing the Metadata page. Another thing to keep in mind is that if you simply change the statement to do the cast:

, CAST(0 AS bit) AS NewColumn1
, CAST(NULL AS nvarchar(max) AS NewColumn2

That won't work, as the underlying metadata will remain DT_I4. You will have to remove the new columns from the Source, to force the meta data to update, and then re-add them in order to solve the issue.

When you're done doing this for all data sources, the error ought to disappear, and you can finally set up the columns correctly in the Union All component.