Using string conversions in VS SSIS

Venkat Venkataramanan 76 Reputation points
2022-07-31T18:31:00.323+00:00

Hello:

I have a question related to data conversions in VS SSIS.

I have a string variable of length 500 but I needed the left 300.
I created a new derived column:

dosage_v = LEFT([dose], 300)

But the data type is set set Unicode String [DT_WSTR]

I wanted to convert the data type to STR using the cast function:

dosage_V = (DT_STR, 300, 1251)@[LEFT( [dose_vbm] , 300)]

But VS does not like the @.

What am I doing wrong?

Thanks.

SQL Server Integration Services
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 41,536 Reputation points
    2022-08-01T01:22:35.91+00:00

    Hi @Venkat Venkataramanan ,

    The expression in the derived column should be like below:

    (DT_STR,300,1251)LEFT(dose_vbm,300)  
    

    226531-image.png

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.