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!

Output special chars for beg / end row qualifiers of csv file 1

Status
Not open for further replies.

benaround

Programmer
Dec 2, 2003
76
US
In using DTS to output a table as a comma seperated set of fields, I have used the normal Import/Export wizzard.

For a sepecial case, I have to have a open bracket, {, and a close bracket, }, as the beginning and ending of a row / record for a text file.

I have looked at the VB code and have tried to navigate changes to have this work properly, but to no avail.

Thanks for any help ahead of time.
 
You need to modify your SELECT statement that is exporting the table to the CSV file. Hopefully, the first and last columns will be of a VarChar/Char variety.

If so for example, Field1 and Field10 are defined as VarChar(20), we could ...

Modify your SELECT Statement to be somthing like this...

SELECT '{' + Field1, Field2, Field3, ... Field10 + '}'

IF your first and/or last fields in the SELECT are not of the VacChar/Char variety ... you may want to order the fields that you are selecting to have the first and last fields as character types.

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top