March 13, 2017 at 5:56 am
hi,
I found "Order of Attributes
The order of attributes in an XML instance is not preserved. When you query the XML instance stored in the xml type column, the order of attributes in the resulting XML may be different from the original XML instance."
from a link https://msdn.microsoft.com/en-us/library/bb510442.aspx
Q1) does that mean elements like following will not have any order that means
i may get xyz1 then xyz. or it will be orderd?
<p>xyz</p>
<p>xyz1</p>
yours sincerely
March 13, 2017 at 7:41 am
rajemessage 14195 - Monday, March 13, 2017 5:56 AMhi,I found "Order of Attributes
The order of attributes in an XML instance is not preserved. When you query the XML instance stored in the xml type column, the order of attributes in the resulting XML may be different from the original XML instance."
from a link https://msdn.microsoft.com/en-us/library/bb510442.aspx
Q1) does that mean elements like following will not have any order that means
i may get xyz1 then xyz. or it will be orderd?<p>xyz</p>
<p>xyz1</p>yours sincerely
About all I can say here is that the documentation explicitly tells you the answer to your question. As with any query in any DBMS if you want the results in a certain there is 1 and only 1 way to ensure that order...by adding an order by clause.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply