-
Adding Leading 0's in SSIS through Expression
Hi All,
Issue seems to be simple - but i am trying too hard to find a solution for this .. any help would be greatly appreciated.
I am trying to add leading 0's in my destination table --> I get data from csv file and the destination is table.
I used to derived columns to change the column for example I have a "Record Type" which has input 1 and when it is loaded in the table it has to be "01". I used derived columns and gave the following expression:
(DT_WSTR,2)(RIGHT("00" + (DT_WSTR,2)[Record Type],2))
I also tried using Replicate with other functions - but i am not getting the desired result.
Note: Data type of "Record Type" Which comes has an input is DT_I2.
Thanks in advance.
Regards,
varun
-
Don't think DT_I2 is valid data type in sql server.
-
@rmiao
Thanks for your reply.. could you please give me some suggestion on how to handle this .. little bit more elaborate - thanks
-
Which rdbms is your destination table on?
-
Adding Leading 0s in SSIS through Expression
I tried using Citadel and I had it working for email however I could never get spamassassin to work with it so I gave up on it.
If I go back to Citadel how do I get my mail that is in the Maildir folder to it and do you have any hints on how to get spamassassin to work with it?
-
Your destination column type needs to be CHAR for leading 0 to work. You will have to use CONVERT or CAST to change input data type to CHAR as well.
Last edited by skhanal; 12-07-2011 at 01:36 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|