SQL Server 2012 SP_HELPTEXT额外的行问题 [英] SQL server 2012 SP_HELPTEXT extra lines issue

查看:746
本文介绍了SQL Server 2012 SP_HELPTEXT额外的行问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server 2012,&总是使用 SP_HELPTEXT 来获得我以前创建的存储过程。在以前版本的SQL服务器中,在这个过程中没有问题,但在2012年,我的存储过程带有额外的行例如这是我写的程序

pre $ code创建过程SP_Test
作为
begin
选择*
from table_ABC
end

现在使用 SP_HELPTEXT 与此过程(或任何其他过程),我得到此输出

 创建proc SP_Test 

as

开始

从表格中选择*




$ b

其他人也面临这个问题,或者我是这个星球上唯一一个与这个问题斗争的人?
是否有任何机构知道如何解决这个问题?

我的SQL服务器的配置如下(从 Help - > About Microsoft SQL Server Management Studio 11.0.2100.60
Microsoft Analysis Services客户端工具11.0.2100.60
Microsoft数据访问组件(MDAC)6.1.7601.17514
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.0.8112.16421
Microsoft .NET Framework 4.0.30319.269
操作系统6.1.7601

Thanx提前。

解决方案我可以复制这种行为,如果我运行 sp_helptext 结果到网格设置,然后复制并将结果从网格粘贴到新的查询或任何其他文本编辑器。

这似乎是 sp_helptext code>从以前的edi因为这个效果不是用标准的网格结果集显示的。

最简单的解决方法是运行 sp_helptext 结果到文本 set( Query - > 结果到 $ c>> 结果到文本,快捷键 CTRL + T

您可能需要增加 Results to text 中每行的最大字符数以获取输出您期望 - 工具> 选项> 查询结果> 结果到文本 - 设置每列显示的最大字符数为最大值8192。


I am using SQL server 2012, & always use SP_HELPTEXT to get my previously created Stored Procedures, In previous versions of SQL server there were no issues in this process but in 2012, My Stored Procedures come with extra lines, for example this is the procedure that I wrote

Create proc SP_Test
as
begin
 Select * 
 from table_ABC
end

Now after using SP_HELPTEXT with this procedure (or any other procedure), I am getting this output

Create proc SP_Test

as

begin

 Select * 

 from table_ABC

end

Do any one else also facing this problem or I am the only one on this planet to struggle with this issue ?? Does any body know how to solve this issue ??

Configuration of my SQL server is as follows (copied from Help -> About )

Microsoft SQL Server Management Studio          11.0.2100.60
Microsoft Analysis Services Client Tools        11.0.2100.60
Microsoft Data Access Components (MDAC)         6.1.7601.17514
Microsoft MSXML                     3.0 6.0 
Microsoft Internet Explorer             9.0.8112.16421
Microsoft .NET Framework                4.0.30319.269
Operating System                    6.1.7601

Thanx in advance.

解决方案

I can replicate this behaviour if I run sp_helptext with Results to grid set, then copy and paste the results from grid into a new query or any other text editor.

This seems to be a change in the behaviour of sp_helptext from previous editions, since this effect isn't displayed with standard grid result sets.

The simplest work-around will be to run sp_helptext with Results to text set (Query -> Results to > Results to text, shortcut CTRL + T.

You may need to increase the maximum number of characters per line in Results to text to get the output you expect - Tools > Options > Query Results > Results to text - set "maximum number of characters displayed in each column" to the maximum value of 8192.

这篇关于SQL Server 2012 SP_HELPTEXT额外的行问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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