Link to home
Start Free TrialLog in
Avatar of soozh
soozhFlag for Sweden

asked on

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.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

>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.
Avatar of soozh

ASKER

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?
>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?
Avatar of soozh

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of soozh

ASKER

yes
then I don't know how this could be "truncated" ... except maybe in the code
Avatar of soozh

ASKER

The problem seems to be solved when i rebooted everything.  The solution seems to be GRID XML data unlimited.

Thanks