Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Convert Int to varchar in DTS

Convert Int to varchar in DTS

Convert Int to varchar in DTS

I have a DTS package that has integer values which I want to convert to chars because they are dropping the leading zeros in the export.  I have search for information on this and I tried adding a convert or cast into the select statement but no matter what I do the leading zeros are still gone.  Does anyone know of anyway to export a file in DTS to a csv file and keep the leading zeros?  From what I read converting it to a varchar/char should work, but it is not working for me.  When I go through the export process and put in the select statement and then look at the mappings under Transform, I see the fields and they say they are char, but when I open the output the zeros are gone.

Any help would be appreciated, this is driving me nuts


RE: Convert Int to varchar in DTS

Assuming you're using a Text File (Destination), double-click the icon and change the text qualifier from "<none>" to "Double Quote {"}"
Under the Transform Data Task Properties window, make sure that the field has a Type of "Quotable".

soi là, soi carré

RE: Convert Int to varchar in DTS

I would recommend looking at the advanced options of the source and destination.  There are data types options in there too.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close