I have a need to output data from a simple database table to a XML file. The
FOR XML EXPLICITmode creates a 3 level xml output and seemed to work fine
with a small amount of data. At approx 256 characters; the output is cutoff.
What is causing this and can it be corrected? I need to build an XML file
much larger. Should I be doing something different? I would like to have a
SQL solution as I want to set this process up as part of a SQL Job.
Any help would be appreciated...
"NewtoSQLXML" <NewtoSQLXML@.discussions.microsoft.com> wrote in message
news:4C1E7788-396B-4F4E-9759-731ABA472F1F@.microsoft.com...
> I have a need to output data from a simple database table to a XML file.
The
> FOR XML EXPLICITmode creates a 3 level xml output and seemed to work fine
> with a small amount of data. At approx 256 characters; the output is
cutoff.
> What is causing this and can it be corrected? I need to build an XML file
> much larger. Should I be doing something different? I would like to have
a
> SQL solution as I want to set this process up as part of a SQL Job.
> Any help would be appreciated...
In Query Analyzer, go to Tools->Options
Click the Results tab and set your Maximum characters per column to 8000.
Rick Sawtell
|||The problem is that you are just viewing the output in SQL Server Query
Analyzer and it doesn't show the results of FOR XML queries too well. You
can increase the SQL Server Query Analyzer column width as Rick pointed out,
but that will only help if the total amount of XML is less than 8000
characters, what you really need to do is write some code (in VB, or .NET,
or even just some script) to run the query and put the output into a file.
There is an example of some script that you can run in DTS here
http://www.sqlxml.org/faqs.aspx?faq=10
Sean
"NewtoSQLXML" <NewtoSQLXML@.discussions.microsoft.com> wrote in message
news:4C1E7788-396B-4F4E-9759-731ABA472F1F@.microsoft.com...
>I have a need to output data from a simple database table to a XML file.
>The
> FOR XML EXPLICITmode creates a 3 level xml output and seemed to work fine
> with a small amount of data. At approx 256 characters; the output is
> cutoff.
> What is causing this and can it be corrected? I need to build an XML file
> much larger. Should I be doing something different? I would like to have
> a
> SQL solution as I want to set this process up as part of a SQL Job.
> Any help would be appreciated...
No comments:
Post a Comment