Management Studio 中的结果集列宽 [英] Resultset column width in Management Studio

查看:17
本文介绍了Management Studio 中的结果集列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 SQL Server 2005 Management Studio 中更改结果集的列宽?

我有一列包含一个句子,尽管有屏幕空间,但它还是被截断了.

|富|foo2 |说明 ||富|foo2 |说明 ||--------------------------|致 |---------------------------------||× |yz |一个例子.. ||× |yz |例句 |

我希望能够通过代码设置列大小,以便此更改可以通过代码迁移到其他 SSMS 实例.

解决方案

不,每列的宽度是在运行时确定的,在我使用过的任何版本的 Management Studio 中都无法覆盖它.事实上,我认为该算法在 SQL Server 2008 中变得更糟,并且从那以后基本上是一样的——你可以运行相同的结果集两次,并且在相同的输出中网格不一致(这是 SQL Server 2014 CTP2):

我在 2008 年报告了这个错误,但很快就以无法修复"的形式关闭了:

如果您想对此进行控制,您必须为 Management Studio 创建一个可以处理结果网格的加载项,或者您必须编写自己的查询工具.

2016 年 1 月 12 日更新:此网格未对齐问题应在 Management Studio 的最新版本(UserVoice item 已经更新,但他们承认它可能仍然不完美).

Is there any way to alter the column width of a resultset in SQL Server 2005 Management Studio?

I have a column which contains a sentence, which gets cut off although there is screen space.

| foo | foo2 | description |          | foo | foo2 | description         |
|--------------------------|    TO    |----------------------------------|
|  x  |  yz  | An Exampl.. |          |  x  |  yz  | An Example sentence |

I would like to be able to set the column size via code so this change migrates to other SSMS instances with the code.

解决方案

No, the width of each column is determined at runtime, and there is no way to override this in any version of Management Studio I've ever used. In fact I think the algorithm got worse in SQL Server 2008, and has been essentially the same ever since - you can run the same resultset twice, and the grid is inconsistent in the same output (this is SQL Server 2014 CTP2):

I reported this bug in 2008, and it was promptly closed as "Won't Fix":

If you want control over this, you will either have to create an add-in for Management Studio that can manhandle the results grid, or you'll have to write your own query tool.

Update 2016-01-12: This grid misalignment issue should be fixed in the latest builds of Management Studio (the UserVoice item has been updated, but they admit it might still be imperfect).

这篇关于Management Studio 中的结果集列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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