Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

XML size in a stored procedure

Posted on 2015-02-03
8
Medium Priority
?
92 Views
Last Modified: 2015-02-11
I have a stored procedure on SQL Server 2008 that returns an xml document.

It appears that the size of the xml is being truncated to 2Mb.

I have modified the max size of xml in Management Studio to unlimited but I still get the problem.

I wonder if there is some limitation on the size of the variable declared in the stored procedure, or the size of the result set?

Thanks for any advice.
0
Comment
Question by:soozh
  • 4
  • 4
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40586104
>It appears that the size of the xml is being truncated to 2Mb.
this is only the default output indeed.
if you check the len( youxml ), you will get the proper value, normally.
0
 

Author Comment

by:soozh
ID: 40586111
len(yourxml) does not work because it does not like xml data types.  Datalength does.

I have changed the outputr size to unlimited.

Somewhere i am being truncated to 2mb.

An should this SP be run by SQL Server Agent how do it set the size to unlimited there?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40586129
>Datalength does.
yes, sorry. does it show the good size value?

>An should this SP be run by SQL Server Agent how do it set the size to unlimited there?
the question is what are you doing with the "output", in regards to sql server agent?
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:soozh
ID: 40586171
With regards to the size issue when i run the sp in management studio:

The sp returns the xml, but when i click on it i get a message that its is malformed.  When i copy it and paste it into a file i get a file that is about (plus mins a few byte) 2mB

So i think that either the xml is truncated in the sp to 2Mb, or the transfer to Management Studio truncates the resulting xml to 2Mb.

I have changed the size to unlimited.

With regards to SQL Server Agent:

Just a question.  I have no intention of doing it but i was just wondering about other environments suchs an application.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 40586236
so, you confirm to have set in the Query Options, Grid, XML data to "unlimited" ?
0
 

Author Comment

by:soozh
ID: 40586379
yes
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40588428
then I don't know how this could be "truncated" ... except maybe in the code
0
 

Author Comment

by:soozh
ID: 40602810
The problem seems to be solved when i rebooted everything.  The solution seems to be GRID XML data unlimited.

Thanks
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question