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!

Importing Only 256 Chars From Text File

Status
Not open for further replies.

EdwinGene

Programmer
Sep 2, 2003
154
US
I'm having an unusual problem. I'm importing a text file, but I'm only getting the first 256 characters of each record.

The text file, however, is a little unusual, so I'm wondering if that might be the problem.

My customer created an ostensibly comma-delimited file. However, the file has a COMMENTS field, and this COMMENTS field can and does contain Commas, Single-Quotes, Double-Quotes, and CRLFs. Because of this they cannot put a text qualifier around the COMMENTS field, and they are using the Pipe character ( | ) as a record-delimiter. The records are variable-length because of the COMMENTS field.

To import this file I have to define it as a delimited file (because of the variable length records). I can select the Pipe character (Vertical Bar) as the Row Delimiter, but have had to make up a weird combination of characters (which will never appear in the text file) for a column delimiter.

After doing this I can import each record as a single column, and parse the records after the file has been imported. Unfortunately, DTS is importing only the first 256 characters of each text file record.

Has anyone seen or experienced this phenomenon, before? Is the text file and the weirdness of what I have to do to import it causing DTS to become confused, or something?
 
Take a look at the field length of the table you are importing into. Maybe it has been defined as a Char,VarChar or nVarChar of 256.

I would create the table myself. Set the column and length as VarChar(8000) to capture everything. The when you DTS the file in, point to your table.

Thanks

J. Kusch
 
The table I am importing into has one varchar column 2100 characters in length. More than enough room.
 
I figured it out. It had nothing to do with the text file. It was a display option of Query Anaylzer. The data was all there, I just couldn't see it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top