FOR XML AUTO, ELEMENTS - XML SOAP
This is a discussion on FOR XML AUTO, ELEMENTS - XML SOAP ; I am using SQL Server 2000.
When I run SQL in Query ****yzer similar to the following, each row in the
results is truncated to 256 characters:
SELECT * FROM tblName
FOR XML AUTO, ELEMENTS
How can I prevent the ...
-
FOR XML AUTO, ELEMENTS
I am using SQL Server 2000.
When I run SQL in Query ****yzer similar to the following, each row in the
results is truncated to 256 characters:
SELECT * FROM tblName
FOR XML AUTO, ELEMENTS
How can I prevent the output from truncating each row?
Also, is it possible for the output to be formatted with a CRLF after each
element, and appropriate indentation of elements?
Thanks
Bill
-
Re: FOR XML AUTO, ELEMENTS
First, you can increase the limit of the result to 4000 characters. That way
you will see everything. However, since the query ****yzer does not really
understand the XML, you should not attempt to use the XML there except for
doing visual checks. If you want to get the XML in a stream, use either the
ADO/ADO.Net mechanisms to get the XML stream back or use the SQLXML ISAPI.
In the later case, you would access the data through IE, and thus you would
get your pretty-printing of the XML.
Best regards
Michael
"bill" <belgie@datamti.com> wrote in message
news:eHYVIBm3FHA.3952@TK2MSFTNGP10.phx.gbl...
>I am using SQL Server 2000.
>
> When I run SQL in Query ****yzer similar to the following, each row in the
> results is truncated to 256 characters:
>
> SELECT * FROM tblName
> FOR XML AUTO, ELEMENTS
>
> How can I prevent the output from truncating each row?
>
> Also, is it possible for the output to be formatted with a CRLF after each
> element, and appropriate indentation of elements?
>
> Thanks
> Bill
>
>
-
Re: FOR XML AUTO, ELEMENTS
I always change my settings to display 8192 instead of the annoying 256
standard. 8192 seems to be the maximum, but perhaps I have 4192 too much?
Best regards
Niklas Engfelt
"Michael Rys [MSFT]" <mrys@online.microsoft.com> wrote in message
news:%23lVFYRm3FHA.3400@tk2msftngp13.phx.gbl...
> First, you can increase the limit of the result to 4000 characters. That
> way you will see everything. However, since the query ****yzer does not
> really understand the XML, you should not attempt to use the XML there
> except for doing visual checks. If you want to get the XML in a stream,
> use either the ADO/ADO.Net mechanisms to get the XML stream back or use
> the SQLXML ISAPI. In the later case, you would access the data through IE,
> and thus you would get your pretty-printing of the XML.
>
> Best regards
> Michael
>
> "bill" <belgie@datamti.com> wrote in message
> news:eHYVIBm3FHA.3952@TK2MSFTNGP10.phx.gbl...
>>I am using SQL Server 2000.
>>
>> When I run SQL in Query ****yzer similar to the following, each row in
>> the
>> results is truncated to 256 characters:
>>
>> SELECT * FROM tblName
>> FOR XML AUTO, ELEMENTS
>>
>> How can I prevent the output from truncating each row?
>>
>> Also, is it possible for the output to be formatted with a CRLF after
>> each
>> element, and appropriate indentation of elements?
>>
>> Thanks
>> Bill
>>
>>
>
>
-
Re: FOR XML AUTO, ELEMENTS
Too much is not a problem. The reason why I said 4000 is that each stream
block (ie a row chunk) that is being returned is around 2034 bytes, so 4000
is enough).
But regardless of the setting, if you get the XML in more than one chunk in
the query ****yzer, you will have to do some postprocessing to get rid of
the newlines.
Best regards
Mcihael
"Niklas E" <raven_tln0sp4m@hotmail.com> wrote in message
news:%23MC0RKy4FHA.2364@TK2MSFTNGP12.phx.gbl...
>I always change my settings to display 8192 instead of the annoying 256
>standard. 8192 seems to be the maximum, but perhaps I have 4192 too much?
>
> Best regards
> Niklas Engfelt
>
>
> "Michael Rys [MSFT]" <mrys@online.microsoft.com> wrote in message
> news:%23lVFYRm3FHA.3400@tk2msftngp13.phx.gbl...
>> First, you can increase the limit of the result to 4000 characters. That
>> way you will see everything. However, since the query ****yzer does not
>> really understand the XML, you should not attempt to use the XML there
>> except for doing visual checks. If you want to get the XML in a stream,
>> use either the ADO/ADO.Net mechanisms to get the XML stream back or use
>> the SQLXML ISAPI. In the later case, you would access the data through
>> IE, and thus you would get your pretty-printing of the XML.
>>
>> Best regards
>> Michael
>>
>> "bill" <belgie@datamti.com> wrote in message
>> news:eHYVIBm3FHA.3952@TK2MSFTNGP10.phx.gbl...
>>>I am using SQL Server 2000.
>>>
>>> When I run SQL in Query ****yzer similar to the following, each row in
>>> the
>>> results is truncated to 256 characters:
>>>
>>> SELECT * FROM tblName
>>> FOR XML AUTO, ELEMENTS
>>>
>>> How can I prevent the output from truncating each row?
>>>
>>> Also, is it possible for the output to be formatted with a CRLF after
>>> each
>>> element, and appropriate indentation of elements?
>>>
>>> Thanks
>>> Bill
>>>
>>>
>>
>>
>
>
-
Re: FOR XML AUTO, ELEMENTS
Yes a bit annoying that you have to do that yourself instead of checking
that "Don't give me irrelevant New-Lines"-CheckBox in QA.
It would have
been nicer without this setting and that QA automatically gave you the
correct line length and that stream blocks were automatically appended as
well. I don't know any people who want them divided this way. Divided
between the tags works fine, but not like this in the middle after 2034
bytes.
I have found EmEditor to be very useful in these cases with its RegExp Find
& Replace: \r\n -> <nothing>.
Best regards
Niklas Engfelt
"Michael Rys [MSFT]" <mrys@online.microsoft.com> wrote in message
news:uRu47C16FHA.3232@TK2MSFTNGP15.phx.gbl...
> Too much is not a problem. The reason why I said 4000 is that each stream
> block (ie a row chunk) that is being returned is around 2034 bytes, so
> 4000 is enough).
>
> But regardless of the setting, if you get the XML in more than one chunk
> in the query ****yzer, you will have to do some postprocessing to get rid
> of the newlines.
>
> Best regards
> Mcihael
>
> "Niklas E" <raven_tln0sp4m@hotmail.com> wrote in message
> news:%23MC0RKy4FHA.2364@TK2MSFTNGP12.phx.gbl...
>>I always change my settings to display 8192 instead of the annoying 256
>>standard. 8192 seems to be the maximum, but perhaps I have 4192 too much?
>>
>> Best regards
>> Niklas Engfelt
>>
>>
>> "Michael Rys [MSFT]" <mrys@online.microsoft.com> wrote in message
>> news:%23lVFYRm3FHA.3400@tk2msftngp13.phx.gbl...
>>> First, you can increase the limit of the result to 4000 characters. That
>>> way you will see everything. However, since the query ****yzer does not
>>> really understand the XML, you should not attempt to use the XML there
>>> except for doing visual checks. If you want to get the XML in a stream,
>>> use either the ADO/ADO.Net mechanisms to get the XML stream back or use
>>> the SQLXML ISAPI. In the later case, you would access the data through
>>> IE, and thus you would get your pretty-printing of the XML.
>>>
>>> Best regards
>>> Michael
>>>
>>> "bill" <belgie@datamti.com> wrote in message
>>> news:eHYVIBm3FHA.3952@TK2MSFTNGP10.phx.gbl...
>>>>I am using SQL Server 2000.
>>>>
>>>> When I run SQL in Query ****yzer similar to the following, each row in
>>>> the
>>>> results is truncated to 256 characters:
>>>>
>>>> SELECT * FROM tblName
>>>> FOR XML AUTO, ELEMENTS
>>>>
>>>> How can I prevent the output from truncating each row?
>>>>
>>>> Also, is it possible for the output to be formatted with a CRLF after
>>>> each
>>>> element, and appropriate indentation of elements?
>>>>
>>>> Thanks
>>>> Bill
>>>>
>>>>
>>>
>>>
>>
>>
>
>
-
Re: FOR XML AUTO, ELEMENTS
Well, yes. The SQL Server 2005 integration is now much better, we even have
a hyperlink triggered XML editor build in now.
So go out and upgrade :-).
Best regards
Michael
"Niklas E" <raven_tln0sp4m@hotmail.com> wrote in message
news:%23927VrQAGHA.832@tk2msftngp13.phx.gbl...
> Yes a bit annoying that you have to do that yourself instead of checking
> that "Don't give me irrelevant New-Lines"-CheckBox in QA.
It would have
> been nicer without this setting and that QA automatically gave you the
> correct line length and that stream blocks were automatically appended as
> well. I don't know any people who want them divided this way. Divided
> between the tags works fine, but not like this in the middle after 2034
> bytes.
>
> I have found EmEditor to be very useful in these cases with its RegExp
> Find & Replace: \r\n -> <nothing>.
>
> Best regards
> Niklas Engfelt
>
>
> "Michael Rys [MSFT]" <mrys@online.microsoft.com> wrote in message
> news:uRu47C16FHA.3232@TK2MSFTNGP15.phx.gbl...
>> Too much is not a problem. The reason why I said 4000 is that each stream
>> block (ie a row chunk) that is being returned is around 2034 bytes, so
>> 4000 is enough).
>>
>> But regardless of the setting, if you get the XML in more than one chunk
>> in the query ****yzer, you will have to do some postprocessing to get rid
>> of the newlines.
>>
>> Best regards
>> Mcihael
>>
>> "Niklas E" <raven_tln0sp4m@hotmail.com> wrote in message
>> news:%23MC0RKy4FHA.2364@TK2MSFTNGP12.phx.gbl...
>>>I always change my settings to display 8192 instead of the annoying 256
>>>standard. 8192 seems to be the maximum, but perhaps I have 4192 too much?
>>>
>>> Best regards
>>> Niklas Engfelt
>>>
>>>
>>> "Michael Rys [MSFT]" <mrys@online.microsoft.com> wrote in message
>>> news:%23lVFYRm3FHA.3400@tk2msftngp13.phx.gbl...
>>>> First, you can increase the limit of the result to 4000 characters.
>>>> That way you will see everything. However, since the query ****yzer
>>>> does not really understand the XML, you should not attempt to use the
>>>> XML there except for doing visual checks. If you want to get the XML in
>>>> a stream, use either the ADO/ADO.Net mechanisms to get the XML stream
>>>> back or use the SQLXML ISAPI. In the later case, you would access the
>>>> data through IE, and thus you would get your pretty-printing of the
>>>> XML.
>>>>
>>>> Best regards
>>>> Michael
>>>>
>>>> "bill" <belgie@datamti.com> wrote in message
>>>> news:eHYVIBm3FHA.3952@TK2MSFTNGP10.phx.gbl...
>>>>>I am using SQL Server 2000.
>>>>>
>>>>> When I run SQL in Query ****yzer similar to the following, each row in
>>>>> the
>>>>> results is truncated to 256 characters:
>>>>>
>>>>> SELECT * FROM tblName
>>>>> FOR XML AUTO, ELEMENTS
>>>>>
>>>>> How can I prevent the output from truncating each row?
>>>>>
>>>>> Also, is it possible for the output to be formatted with a CRLF after
>>>>> each
>>>>> element, and appropriate indentation of elements?
>>>>>
>>>>> Thanks
>>>>> Bill
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Similar Threads
-
By Application Development in forum Adobe Photoshop
Replies: 0
Last Post: 05-01-2007, 02:44 PM
-
By Application Development in forum XML SOAP
Replies: 3
Last Post: 09-08-2006, 07:18 AM
-
By Application Development in forum XML SOAP
Replies: 3
Last Post: 03-24-2006, 03:57 PM
-
By Application Development in forum XML SOAP
Replies: 2
Last Post: 03-23-2006, 09:57 PM
-
By Application Development in forum XML SOAP
Replies: 3
Last Post: 07-15-2005, 05:11 AM