views:

258

answers:

1

The excel spreadsheet is connecting to SQL server 2005 using the connection string below:

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=XXXXXX;Data Source=XXXXXX;Extended Properties="HDR=No";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=XXXXXX;Use Encryption for Data=False;Tag with column collation when possible=False

It then pulls data from a view into Excel. The business user wants this information without a header row. This will allow her to review then save as a "headless" csv in SAGE file format.

I attempted to alter the connection string by adding HDR=No but that hasn't worked. Additionally, I can't delete the header row. Deleting the content replaces the column names with "Column 1" etc.

Any ideas appreciated!

+1  A: 

One way to try is by giving a space as column alias.

SELECT field1 ' ', field2 ' ' FROM table1

stackoverflow
Thank you, that works as it gives me a blank header row. The only caveat, the first column is a single space, all the others need an additional space e.g. 2 spaces for second column, 3 for the third column. Otherwise it gives the succeeding columns a header name of 2, 3, 4 etc. Much appreciated.
ekoner