469,935 Members | 2,155 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,935 developers. It's quick & easy.

Why XML Output is Truncated

Mo
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

Jul 30 '07 #1
3 9801
On Mon, 30 Jul 2007 07:51:41 -0700, Mo wrote:
>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
Jul 30 '07 #2
Mo
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

Jul 31 '07 #3
On Mon, 30 Jul 2007 18:37:42 -0700, Mo wrote:
>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
Aug 1 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jerry | last post: by
2 posts views Thread by Thomas Hermann | last post: by
2 posts views Thread by dwight0 | last post: by
5 posts views Thread by z. f. | last post: by
reply views Thread by Chris | last post: by
7 posts views Thread by Kenevel | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.