Select For XML Explicit - MSSQL

Select For XML Explicit - MSSQL

code snippet

mssql
SELECT         1 AS Tag
	  , NULL AS Parent
	  , NULL AS [Objects!1!Empty!hide]
	  , NULL AS [Object!2!Field1]
	  , NULL AS [Object!2!Field2]
	  , NULL AS [Object!2!Field3]
UNION ALL 
SELECT     2 AS Tag
	  , 1 AS Parent
          , NULL -- [Objects!1!Empty!hide]
          , Field1 -- [Object!2!Field1]
          , Field2 -- [Object!2!Field2]
          , Field3 -- [Object!2!Field3]
 FROM dbo.TABLE_NAME
ORDER BY [Object!2!Field1]
FOR XML EXPLICIT

"Thinking: the talking of the soul with itself"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.