問題描述
我使用的是 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 個字符的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!