Select DT=Getdate() into #TEMP
SELECT * from #TEMP FOR XML AUTO
SELECT * from #TEMP FOR XML RAW
Quote:The RAW mode generates a single element per row in the rowset that is returned by the SELECT statement. You can generate XML hierarchy by writing nested FOR XML queries.
The AUTO mode generates nesting in the resulting XML by using heuristics based on the way the SELECT statement is specified. You have minimal control over the shape of the XML generated. The nested FOR XML queries can be written to generate XML hierarchy beyond the XML shape that is generated by AUTO mode heuristics.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)