Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

For Loop Expression - Casting Error Expand / Collapse
Author
Message
Posted Wednesday, September 19, 2012 10:40 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 3:01 PM
Points: 45, Visits: 334
I am trying to program a For Loop container and cannot get the For Loop Properties expressions set. I have simplified the expression to the following:

@Test_Date=(DT_DBTIMESTAMP)@Max_Load_Date

I get the following error messages:

Error at For Loop Container: Error code 0x80020005 occured attempting to convert from data type DT_WSTR to data type DT_DBTIMESTAMP.

Error at For Loop Container: Casting Expression "@Max_Load_Date" from data type "DT_WSTR" to data type "DT_DBTIMESTAMP" failed with error code 0XC00470C2.

AND I FOUND THE FIX WHILE WRITING THIS POST.

I did not populate the variables with a default value. I left them blank. SSIS probably treats it as a blank and not a null. Thus causing the conversion errors. Populated the default values and all is good.

I figured I'd complete the post hoping it'll help someone else.

Rob
Post #1361729
Posted Thursday, September 20, 2012 12:56 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, April 4, 2014 5:29 AM
Points: 967, Visits: 396

AND I FOUND THE FIX WHILE WRITING THIS POST.

[...]

I figured I'd complete the post hoping it'll help someone else.


Good on you, for both parts of that.



Post #1361760
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse