XML size in a stored procedure

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.
soozhAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
so, you confirm to have set in the Query Options, Grid, XML data to "unlimited" ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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
 
soozhAuthor Commented:
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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
 
soozhAuthor Commented:
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
 
soozhAuthor Commented:
yes
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
then I don't know how this could be "truncated" ... except maybe in the code
0
 
soozhAuthor Commented:
The problem seems to be solved when i rebooted everything.  The solution seems to be GRID XML data unlimited.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.