There are several ways to get .value to extract an item of information from xml. in the following article I will show some of the syntax and reasons why some methods are better than others.
All the calls in this post will all reference the following blob. This is a simple blob for demonstration purposes only.
The Following 3 methods of .value calls all work and will all bring back the same value (which is the first person element in the blob)
DECLARE @xml xml = N'<xmlblob><personlist><person>Phil</person><person>Stina</person></personlist></xmlblob>’
The first query is potentially the kind you would want to have if you were using typed xml via a schema, however in this case without a schema the second query is far better especially with reference to the Query plans generated. this is due to the /text() on the end of the element name that directs the xml to be processed as text.
The third option is interesting as it is the slowest to run under the above conditions and would normally be avoided however the interesting thing with this syntax is that when other elements are accessed the query is seemingly scaled.
The following queries look at the second element in the person list.
Still the second method remains the best with the third following closely behind.
Improvements can be made to the third query by using the text() method as in the second query, but the QP cost is still above that of the second query.