dshi15
asked on
lost header when export to csv file from sql server
Hi Expert,
When I export to csv file from sql server 2008 resoult pane, it lost header, how to solve the problem. I right click on result pane and select to 'save results as' csv file.
Thanks in advance.
When I export to csv file from sql server 2008 resoult pane, it lost header, how to solve the problem. I right click on result pane and select to 'save results as' csv file.
Thanks in advance.
ASKER
and column header no space and no "_" , no special characters.
SSMS options-->query results-->SQL server--> resultstogrid-->check include headers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi roshnipatel, I had same you showed, but still not come out.
Then you should go to Query -> Results To -> results to text.
Re-execute your query.
You'll be prompted to select a file location. If you choose .rpt, once the query has ran, change the file extention to .csv
You should have the headers that way
Re-execute your query.
You'll be prompted to select a file location. If you choose .rpt, once the query has ran, change the file extention to .csv
You should have the headers that way
Because it's results to grid like I indicated earlier, thats the default so I assume thats what your doing.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER