FOR XML PATH 导致 SSMS 被截断为 2034 个字符 [英] FOR XML PATH results in SSMS truncated to 2034 characters

查看:49
本文介绍了FOR XML PATH 导致 SSMS 被截断为 2034 个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 SQL Server 2008 R2.

I'm using SQL Server 2008 R2.

我正在使用for xml path('')"将字符串连接在一起.

I'm concatenating strings together using "for xml path('')".

我已将工具->选项->SQL Server->结果到网格选项设置为最大值.

I have set the Tools->Options->SQL Server->Results to Grid options to max.

我已将工具->选项->SQL Server->结果文本选项设置为最大.

I have set the Tools->Options->SQL Server->Results to Text options to max.

在网格模式下执行查询并复制一行/一列结果,我看到返回值限制为 2034 个字符.

Executing the query in Grid mode and copying the one row/one colum results, I see the return value is limited to 2034 characters.

在文本模式下执行查询并复制一行/一列结果,我看到返回值限制为 1124 个字符.

Executing the query in Text mode and copying the one row/one colum results, I see the return value is limited to 1124 characters.

如何确保返回值不被截断?

How can I ensure the returned value isn't truncated?

推荐答案

在这里找到答案:

https://stackoverflow.com/a/5658758/609058

出于某种原因,将 XML 转换为字符串会返回一个未截断的字符串.

For some reason, converting the XML to a string returns a non-truncated string.

不知道为什么有效,但确实有效.

Not sure why it works, but it does.

这篇关于FOR XML PATH 导致 SSMS 被截断为 2034 个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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