关闭 SQL Server Management Studio 查询结果中标题破折号的显示吗?
在查询窗口中显示文本结果时,如何告诉 SQL Server 2008 Management Studio 关闭标题破折号的打印?
生成的标头破折号示例如下:
selectId, count(*) ContentCount from Table group by Id order by count(*) desc
生成:
Id ContentCount
-------------------- ------------------
622 5
623 1
select 'Person Info'
生成:
------------
Person Info
这些破折号并不适合所有情况,所以我希望有办法将它们关闭。
How can I tell SQL Server 2008 Management Studio to turn off printing of header dashes when displaying text results in a query window?
Examples of header dashes being produced are:
selectId, count(*) ContentCount from Table group by Id order by count(*) desc
produces:
Id ContentCount
-------------------- ------------------
622 5
623 1
select 'Person Info'
produces:
------------
Person Info
Those dashes are not conducive to all situations so I expect there is way to turn them off.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
转到工具、选项、查询结果。如果需要,您可以将输出更改为网格。我没有找到一种方法可以仅关闭“结果到文本”选项中的破折号。检查 - 更改为逗号分隔并且破折号不会显示。
Goto Tools, Options, Query Results. You can change the output to Grid if you want there. I don't see a way to turn off just the dashes in the Results to text options. Check that - change to Comma Delimited and the dashes don't show up.
解决方案:在选项/查询结果/SQL Server/结果到文本下,有一个复选框可以取消选中标题为“在结果集中包含列标题”。
但是,我想以编程方式执行此操作,因为我作为电子邮件报告的一部分执行查询,该报告的标题看起来很混乱,但尚未找到方法(这是 SQL Server 问题)。
Solution : Under Options/Query Results/SQL Server/Results to Text there is a checkbox to untick entitled 'Include column headers in the result set'.
However, I wanted to do this programmatically, as I perform a query as part of an email report that looks a mess with the headers, but haven't found out a way yet (which IS a SQL Server issue).
这是一个不正确的 SQL 语句。
离开
出发和出发
this is an incorrect SQL statement.
set head off
set und off
对于 SQL 查询,请在 Select 语句上方键入以下内容:
要删除标题,请键入:set head off
要删除下划线,请键入:set und off
for a SQL query, type the following above the Select statement:
to remove the headers, type: set head off
to remove the underline, type: set und off