SSIS中dbTimeStamp类型输出列显示为空问题咨询
Let's break down why your ChangeDate column (dbTimeStamp type, length 0) is showing empty values, and walk through how to fix it:
1. Fix the Unmapped Column (Critical!)
Looking at your configuration snippet:
<outputColumn id="20" name="ChangeDate" ... mappedColumnId="0" .../>
The mappedColumnId="0" is a major red flag. In SSIS, mappedColumnId should reference the ID of an input column that feeds data into this output column. A value of 0 means this column isn't linked to any source data at all—so it’s no surprise it’s empty!
How to fix:
- Open your Data Flow Task in the SSIS designer.
- Find the component that produces this output column (e.g., OLE DB Source, Derived Column, Data Conversion).
- Edit the component, head to the Input and Output Properties tab.
- Locate the
ChangeDateoutput column under the appropriate output group, then setmappedColumnIdto the ID of the input column containing your date data (you can find input column IDs under the component's Inputs group). - Alternatively, use the Mappings tab in the component editor to visually drag the source column to
ChangeDate—this will auto-set the correct ID.
2. Validate External Metadata Alignment
Your column has externalMetadataColumnId="19", which links it to an external metadata column (usually a target table column).
- Double-check that the external metadata column (e.g., in your destination table) is a
datetime/datetime2type matchingdbTimeStamp, and that it allows NULL values (unless your source data guarantees non-null dates). - If the target table schema changed recently, refresh the external metadata in the component editor to ensure it’s in sync with the actual table structure.
3. Inspect Conversion Logic
The errorOrTruncationOperation="Conversion" tag tells us this column is the result of a data conversion step.
- Confirm the source data for the conversion isn’t NULL or malformed. For example, if converting a string to dbTimeStamp, make sure the string follows a valid date format like
yyyy-MM-dd HH:mm:ss. - Add a Data Viewer on the component’s output to inspect
ChangeDateright after conversion. This will show you if the value is already empty before reaching the destination. - If using a Derived Column transformation, double-check your expression—ensure it generates a valid date (e.g.,
GETDATE()for the current timestamp, or a valid calculation from other columns) instead of returning NULL.
4. Ignore the Length Attribute (It’s Irrelevant Here)
For dbTimeStamp (DT_DBTIMESTAMP in SSIS), the length="0" setting doesn’t affect anything. Date/time types in SSIS don’t use the length property—that’s only for string, binary, or similar types. You can safely remove this attribute or leave it as-is; it won’t impact your data.
5. Check for Silent NULL Generation
Even though your error disposition is set to FailComponent, it’s possible the conversion isn’t throwing an error but just producing NULL.
- Enable logging for your Data Flow Task (go to SSIS > Logging) and look for warnings related to data conversion or column mapping.
- Run the package in debug mode and step through the Data Flow to pinpoint exactly where the
ChangeDatecolumn becomes empty.
内容的提问来源于stack exchange,提问作者Anurag

