FIX: "Specified cast is not valid" when you load an XML document that has time zone information in SSIS 2012 or SSIS 2014

Applies to: SQL Server 2012 Business IntelligenceSQL Server 2014 Business IntelligenceSQL Server 2014 Business Intelligence

Symptoms


Assume that you use Microsoft SQL Server 2012 Integration Services (SSIS 2012) or SSIS 2014. When you try to load an XML document that has DateTime data type and contains time zone information, you receive the following error message:
[XML Source 1 [9]] Error: The error "Specified cast is not valid." occurred while processing "XML Source 1.Outputs[r].Columns[<ColumnName>]".

Note The SSIS XML source component sets the data type of the column as DT_DBTIMESTAMP. It does not contain time zone information. In advanced editor, when you try to change the data type of the column for both External Columns and Output Columns to preserve the time zone information, you encounter the previously mentioned error message.

Resolution


The issue was first fixed in the following cumulative update of SQL Server.

Cumulative Update 1 for SQL Server 2014 SP1

Cumulative Update 6 for SQL Server 2014

Cumulative Update 5 for SQL Server 2014

Cumulative Update 4 for SQL Server 2012 SP2

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.