# Database Discussions > Microsoft SQL Server 2008 >  Adding Leading 0's in SSIS through Expression

## varun_2003

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

----------


## rmiao

Don't think DT_I2 is valid data type in sql server.

----------


## varun_2003

Thanks for your reply.. could you please give me some suggestion on how to handle this .. little bit more elaborate - thanks

----------


## rmiao

Which rdbms is your destination table on?

----------


## JereArtity

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?

----------


## skhanal

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.

----------

