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

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

About cumulative updates for SQL Server

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Properties

Article ID: 2995622 - Last Review: 06/22/2015 15:07:00 - Revision: 5.0

Microsoft SQL Server 2012 Service Pack 2, Microsoft SQL Server 2012 Business Intelligence, Microsoft SQL Server 2014 Business Intelligence, Microsoft SQL Server 2014 Service Pack 1

  • kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2995622
Feedback