Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leading zeros in csv file

Status
Not open for further replies.

cocopud

Technical User
Jan 8, 2002
139
US
I have a DTS package that has 3 fields for the phone number. In SQL they are smallints and when they come over in the .csv file the leading zeros are dropped. I have tried to change them to chars when I do the DTS export, but the zeros are still missing. Is there any way to keep the zeros in the csv file?
 
Is the data type INT in the SQL table? Obviously that wont work. You may just have to change the data types. Right click on the data source and destination objects and choose advanced options then go to data types.
 
Thanks for the suggestions, but I had changed the data type and it does come over with double quotes but it was still removing the leading zeros. What I ended up doing was pading it with zeros so that it would display the leading zeros or if there was no phone number listed it would display all zeros.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top