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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with IMPORT

Status
Not open for further replies.

pandatime

Programmer
Jan 29, 2010
92
AU
Hi,

I have used import many times (sql server 2005). However the file I am trying to import shows (in the import preview screen) that the last column has a bunch of trailing dots, as in:

col 10
dog ................................
cat ................................

I don't know how many dots there are, I can't see that far!

I have row delimiter set to {LF}. But the import fails due to truncation on col 10 because of these dots I am assuming.

What can I do about this situation? I tried deleted col 10, since it's not essential to the import I'm doing, but the dots just transferred to col 9 instead!

Please help.

Thanks

 
Ok, i see that the "dots" are really SPACES, LOTS AND LOTS OF THEM... if I open the csv file in textpad, I can see that now. So how can I get rid of all these trailing spaces in the file before import - we're talking 50,000+ rows!

???
 
Ok, nevermind I did a manual removal of most of the spaces... but if anyone has any ideas, I'll take them!

I also realize I could use SSIS to trim the data... or maybe bcp or bulk load options??? (don't have time to research right now though)

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top