Hi I am using the When I add in the ' SELECT * FROM dba.table1 ORDER BY table1.part_number ASC; OUTPUT TO 'c:\\filename.csv' FORMAT ASCII QUOTE '"' WITH COLUMN NAMES If not is there a workaround for exporting the column names? |
The WITH COLUMN NAMES clause was added to the OUTPUT command with v12, so it's clearly not available with v9. A workaround is to use two queries:
select list(string('"', cname, '"') order by colno asc) from sys.syscolumns where creator = 'dba' and tname = 'table1'; output to 'c:\\filename.csv' format ascii quote '"';
select * from dba.table1 order by table1.part_number asc; output to 'c:\\filename.csv' format ascii quote '"' append; (Have not tested the queries lacking v9, but you should get the point...) |