Header in export file is changd from #DL to .DL


I am using a SQL statement to write data to CSV file.
The sql statement starts with
The header in the CSV file must start with #DL to allow successful import in destination program.
For some reason the created CSV file does not start with #DL in header, but with .DL

Does anyone knows the reason why # is replaced with . in the CSV file?

How is the data getting from your SELECT query into the file? Perhaps whatever utility / program is actually exporting the data to the CSV file is making that change from "#" to "." ?

The program that is using this SQL statement is a simple MS access program

Jan Guilliams

Hoogbroek 21
3700 Tongeren - Lauw
Gsm 0479/023415

I reckon that that is mangling the "#" for some reason.

I suggest you use SSIS or BCP.

I am using the following command in access to create the file out of the SQL statement:
DoCmd.TransferText acExportDelim

When looking at the table in access, the first header is "#DL", but in the file it appears at ".DL"

I faced a similar issue where I had to provide data to a vendor application that required specific column header values. We were using SSRS to export the data to CSV but I don't see how you can't use a similar solution where the client application complains about the values in your headers.

Select your column headers then union the actual values such as this:

SELECT ColumnHeader1, ColumnHeader2, ColumnHeader#
SELECT ColumnValue1, ColumnValue2, ColumnValue3

Then turn off the column header values in the export file and the first SELECT statement gives you the "header" values you need.

You may have to fight with data type issues. If you can turn it into a VIEW it helps too. It allowed us to solve our problem of providing header values that were normally not supported.