Convert SQL server datetime to SSIS String using SQL only?

  • I am getting a datetime column from SqlServer (SS). I want it to appear as a "String" column to SSIS so that I can directly fit it into an SSIS string. After that, I want to loop over this column with a Foreach loop and assign each row to a SSIS string called "str_SSIS". So, I tried CONVERT(VARCHAR(50), MyDatetimeColumn, 121) and dumped it into a result set.

    But, SSIS complains that the type of the vaue being assigned to variable str_SSIS differs from the current variable type.

    Why could this be happening and how do I fix it ?

    Now, I also get the error - Error: ForEach Variable Mapping number 1 to variable "strMyString" cannot be applied.

    Thanks.

  • In theory everything seems to be correct.

    Can you supply some screenshots of your package design?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply