We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

lost header when export to csv file from sql server

Medium Priority
630 Views
Last Modified: 2012-05-11
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.

Comment
Watch Question

Author

Commented:
this is the longest header in result pane. Q2NonTireMotorcraftTestedToughBattery

Author

Commented:
and column header no space and no "_" , no special characters.
SSMS options-->query results-->SQL server--> resultstogrid-->check include headers
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
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
Because it's results to grid like I indicated earlier, thats the default so I assume thats what your doing.
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.