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 个字符
基础教程推荐
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 无法解决整理冲突 2021-01-01
