如何从 SSMS 获取完整的结果集 [英] how to get the full resultset from SSMS

查看:22
本文介绍了如何从 SSMS 获取完整的结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 SQL Server Management Studio 中获取行的完整内容?

How do you get back the full content of rows in SQL Server Management Studio?

如果您使用结果网格",则数据会被编码,因此诸如换行符之类的内容会丢失.如果您执行result to file"或results to text",则文本限制为 8192 个字符.

If you use "results to grid" the data is encoded, so things like line breaks are lost. If you do "result to file" or "results to text" the text is limited to 8192 characters.

注意:我有解决方案,但我正在使用 SO 来记录这一点.如果您有更好的答案,请随时发布.

NOTE: I have the solution, but I am using SO to document this. If you have a better answer feel free to post it.

推荐答案

I cast it to XML

I cast it to XML

select @variable_with_long_text
 as [processing-instruction(x)] FOR XML PATH 

processing-instruction 位用于阻止它实体化字符,例如 <&lt;

The processing-instruction bit is there to stop it entitising characters such as < to &lt;

这篇关于如何从 SSMS 获取完整的结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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