When would you use the TYPE command at the end of a FOR XML statement?
Eg.
SELECT * FROM MyFile
FOR XML, ELEMENTS, TYPE
The references I have looked up state that the 'TYPE' qualifier will return the results as a proper XML field.
I can't see where this would be an advantage. I can insert XML into an XML data type column or variable without declaring the results as a TYPE...so where is it sueful? What does capacity does it add to a SELECT statement?
Dazed and confused
Eg.
SELECT * FROM MyFile
FOR XML, ELEMENTS, TYPE
The references I have looked up state that the 'TYPE' qualifier will return the results as a proper XML field.
I can't see where this would be an advantage. I can insert XML into an XML data type column or variable without declaring the results as a TYPE...so where is it sueful? What does capacity does it add to a SELECT statement?
Dazed and confused