dbTalk Databases Forums  

Why XML Output is Truncated

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Why XML Output is Truncated in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mo
 
Posts: n/a

Default Why XML Output is Truncated - 07-30-2007 , 09:51 AM






Hi,
I am trying to generate an XML output form the database. I am
executing

select * from Request_vw for xml auto

The output data is being truncated. is there a limit on the output
result of an XML query?

Thanks


Reply With Quote
  #2  
Old   
Hugo Kornelis
 
Posts: n/a

Default Re: Why XML Output is Truncated - 07-30-2007 , 03:17 PM






On Mon, 30 Jul 2007 07:51:41 -0700, Mo wrote:

Quote:
Hi,
I am trying to generate an XML output form the database. I am
executing

select * from Request_vw for xml auto

The output data is being truncated. is there a limit on the output
result of an XML query?

Thanks
Hi Mo,

In SQL Server Management Studio: Tools / Options / Query Results / SQL
Server / Results to Text / Maximum number of characters displayed in
each column

In Query Analyzer: Tools / Options / Results / Maximum characters per
column

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis


Reply With Quote
  #3  
Old   
Mo
 
Posts: n/a

Default Re: Why XML Output is Truncated - 07-30-2007 , 08:37 PM



Thank you for the great pointer. Here is the problem. I am calling a
function to retrieve the data in XML format. The problem is that it
returns only nvarchar(8000) which is smaller than what I need. I think
that is why the returning data is being truncated. my function is as
follows. Any ideas on how to return larger XML string is greatly
appreciated.


CREATE FUNCTION GetXMLRequests()
RETURNS nvarchar(max)
AS
BEGIN
-- Declare the return variable here
RETURN (select * from Request_vw for xml auto)

END
GO


Reply With Quote
  #4  
Old   
Hugo Kornelis
 
Posts: n/a

Default Re: Why XML Output is Truncated - 08-01-2007 , 02:13 PM



On Mon, 30 Jul 2007 18:37:42 -0700, Mo wrote:

Quote:
Thank you for the great pointer. Here is the problem. I am calling a
function to retrieve the data in XML format. The problem is that it
returns only nvarchar(8000) which is smaller than what I need. I think
that is why the returning data is being truncated. my function is as
follows. Any ideas on how to return larger XML string is greatly
appreciated.


CREATE FUNCTION GetXMLRequests()
RETURNS nvarchar(max)
AS
BEGIN
-- Declare the return variable here
RETURN (select * from Request_vw for xml auto)

END
GO
Hi Mo,

Any reason why you want to return nvarchar(max) rather than use the
dedicated xml datatype?

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.