在Sql Server Management Studio中使用标题保存结果 [英] Saving results with headers in Sql Server Management Studio

查看:149
本文介绍了在Sql Server Management Studio中使用标题保存结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server Management Studio。



我希望将查询的结果保存到excel文件。



我选择另存为,然后保存到CSV文件,我可以在excel中打开。所有的好,除了我错过列标题,任何想法如何导出?

解决方案

工具 - >选项 - >查询结果 - > SQl服务器 - >结果到文本(或网格,如果你想) - >在结果集中包含列标题



您可能需要关闭并重新打开SSMS此选项。



* 在SQL编辑器工具栏上,您可以选择保存到文件,而无需重新启动SSMS


I am using SQL Server Management Studio.

I wish to save the results of a query to an excel file.

I choose "save as" and then save to CSV file which I can open in excel. All good except I am missing column headers, any ideas how I get them exported?

解决方案

tools -> options -> query results -> SQl Server -> results to text (or grid if you want) -> Include columns headers in the result set

You might need to close and reopen SSMS after changing this option.

* On the SQL Editor Toolbar you can select save to file without having to restart SSMS

这篇关于在Sql Server Management Studio中使用标题保存结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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