Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Too many columns when importing textfile.

Author  Topic 

eurob
Posting Yak Master

100 Posts

Posted - 2005-12-27 : 13:03:25
I have a .txt file with two values like this

value1,
value2

There is no CRLF or CR after value2.
Even if I do it like this
value1,value2

DTS doesn't want to import saying that there are too many columns found in current row.

Any idea why this happens ?


robert

SamC
White Water Yakist

3467 Posts

Posted - 2005-12-27 : 14:02:19
DTS needs CR, LF or at least LF after each row.

Suggest you edit the source file with Notepad and do a global search / replace to resolve.
Go to Top of Page

eurob
Posting Yak Master

100 Posts

Posted - 2005-12-27 : 14:33:05
I did that, it didn't make any difference.

robert
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-12-27 : 16:02:20
quote:
Originally posted by eurob

DTS doesn't want to import saying that there are too many columns found in current row.

My guess is the table exists already and DTS complains of a column number mismatch.

Try deleting the target table and run DTS again.
Go to Top of Page

eurob
Posting Yak Master

100 Posts

Posted - 2005-12-27 : 16:17:11
So that means that I cannot import into an existing table but have DTS create a table for me ?

robert
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-12-27 : 17:43:33
It's possible to import to an existing table. Why don't you try letting DTS create a table first as a half-step to finding a working solution.

I believe you must "edit the transformation" in a DTS wizard step someplace to work with an existing table.
Go to Top of Page

eurob
Posting Yak Master

100 Posts

Posted - 2005-12-28 : 08:38:03
Thanks, it worked.

robert
Go to Top of Page
   

- Advertisement -