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!

IMPORTING DATA FROM TXT FILE

Status
Not open for further replies.

kissarmi

Programmer
Feb 14, 2002
72
0
0
US
Hi,

I am working on converting tables from my old database for use in SQL and VB. The text files were built with a query utility on the old database. They are comma delimited with quotes signifying the non-numeric fields. I'm using Enterprise Manager and the Import Data function. Some of the conversions work fine. Others are giving me some problems. When setting Text Qualifier to Double Quotes in the DTS Import/Export Wizard, I get an error saying 'invalid delimited data, text qualifier must be followed by a column delimiter'. If I set the Text Qualifier to None, it converts. However, I'm left with the quotes included in my SQL table.
Why would some text files convert with no problem, and others not?

Thanks for any help.
Mitch
 
Hi,

I would check the imput file and make sure that there is a comma after each field, especially after a double quote.

e.g

1,"test text",345345,"fgfgfdg"
 
See

and
For quote delimitted fields - but I prefer to do the field extraction after the import.

It may be that quote delimitters are only used if the field has special characters.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top