如何从 SSMS 获取完整的结果集 [英] how to get the full resultset from 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
位用于阻止它实体化字符,例如 <
到 <
The processing-instruction
bit is there to stop it entitising characters such as <
to <
这篇关于如何从 SSMS 获取完整的结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!