select * from table for xml raw

– generates a list of <row> elements; each element has the table columns values as attributes

select * from table for xml raw(‘ElemName’)

– generates a  list of  <ElemName> elements; each element has the table columns values as attributes

select * from table for xml raw, elements

– generates a list of <row> elements; each column in the table has a corresponding child element; the actual value is delivered in the child element content.

 

Advertisements