Wednesday, February 28, 2018

Datetime conversion from Oracle to MSSQL problem in SSIS

One day I had a problem encountering some problem within SSIS using Datetime conversion especially when passing parameters from one flow to another.

One of the problem which intrigues me that this date time issue when I tries to input


It ran fine on my Evaluate Expression but when I ran my SSIS it came out this problem.

Error: The data types "DT_WSTR" and "DT_DATE" are incompatible for binary operator "+". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

What I did is to change my length to 50 and my variable to pass in as DateTime and everything ran successful.

The DateTime issue will encounter quite common on dealing with databases especially when you are handling different data sources. My advice will be always pass as DateTime rather than convert into string unless you absolutely have to. (eg. showing on UI)


No comments: