问题
When I create the SSIS package it requires a file to be referenced to pick up the files metadata. For example the column headers will be ColumnA, ColumnB.
I have always assumed that these column names need to be present in the file for it to be loaded. Recently business, for whatever reason, changed one of the column names in the file to something else so the file contains ColumnA, NotColumnB. When the SSIS package runs it ignores this and loads the file. I assumed that it would fail. Is my assumption correct and there is something weird going on or is my assumption incorrect, if so please let me know why.
I have changed the column names in a few other packages that load data from a file and they also dont care what the column names are
回答1:
Click on the flat file source, and press F4 to show the properties tab. There are a property called ValidateExternalMetadata
change it to True
.
For more information check the following answer:
- Detect new column in source not mapped to destination and fail in SSIS
Update 1
It looks like that flat file connection manager has no validation engine and the metadata defined is used at configuration time to configure the mappings between the data file and the database.
- Why Does't SSIS Flat File Data Check If Columns Names or Order Have Changed? What is best way to check?
- Flat file destination columns data types validation
来源:https://stackoverflow.com/questions/55873944/source-file-connection-flat-file-not-reading-column-metadata