FOR XML PATH results in SSMS truncated to 2034 characters(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 个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:FOR XML PATH 导致 SSMS 被截断为 2034 个字符


基础教程推荐
- 从字符串 TSQL 中获取数字 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01