I'm debugging an existing sproc in our organization. It's trying to return an XML string (using "for XML auto") that is 2047 bytes long.
When I run the sproc in SSMS, the return value appears in the results window. If I click on the value (shown as a hyperlink), a new window opens and displays the whole string. (By the way, the string is a single XML element with all the data contained in attributes. Not my design, but that's what I'm working with.)
If, however, I view the result in the results pane (by dragging out the width of the column), then the last few bytes are truncated. I see only 2034 characters.
As it's only 2034 characters, it's not a limit of the SSMS results window (2MB by default, now set to Unlimited). This is the exact same string that gets sent to the service that is calling this sproc (via ADO.NET and ExecuteScalar).
Why is the sproc truncating the XML?
Thanks, Jay