Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

SQL Server Select LEN on XML

What is the best way for me to get a true "Length" on an XML field that was inserted using a HttpWebResponse chunked response and a read buffer like this in VB
streamRead.Read(readBuff, 0, 5120)


This is my select
SELECT LEN(CAST(XmlDoc AS VARCHAR(MAX))) xmlDoc FROM      [dbo].[VOIPXMLTransactionLog]

But it seems to be ignoring spaces?
Avatar of jonnidip
jonnidip
Flag of Italy image

Are you sure that spaces are in the variable?
Where are you openinig your file? Maybe in a "visual" editor (just like Internet Explorer)? If so, you may see spaces where there are only tabs, or maybe nothing...
Some viewers/editors apply formatting to XML files.
Please ensure you are not in this case...


Regards.
Avatar of Larry Brister

ASKER

I'm not looking at it in a viewer.

I'm getting a response stream and sending it straight to SQL Server.
ASKER CERTIFIED SOLUTION
Avatar of lenordiste
lenordiste
Flag of France 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
That was it...the DataLength