从SQL Server,如何使用列标题导出到Excel? [英] From SQL Server, how can I export to Excel with the column headers?

查看:177
本文介绍了从SQL Server,如何使用列标题导出到Excel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个约20列的查询,我想将其导出到具有列标题的Excel文件。我以为这很容易弄清楚,但没有运气!我搜索网页,发现一个建议没有结束工作,所以我被卡住了。



任何人都有任何工作想法?



谢谢,

解决方案

我通常只需点击结果网格的左上角,复制,然后粘贴到Excel中。有一个catch,你需要进入选项 - >查询结果 - > SQL Server->结果到网格(或文本,如果你想保存到文件导入到excel),并打开包含列标题复制或保存结果。我发现这很棒。


I have a query that has approx 20 columns and I would like to export this to an Excel file with the column headers. I thought this would be easy to figure out but no luck! I searched the web and found one suggestion that did not end up working so I am stuck.

Anyone have any working ideas?

Thanks,

解决方案

I typically do this by simply click the upper left corner in the results grid, copy, and then paste into Excel. There is one catch, you need to go into options->query results-> SQL Server->results to grid (or text if you want to save to file for import into excel) and turn on include column headers when copying or saving the results. I find this works great.

这篇关于从SQL Server,如何使用列标题导出到Excel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆