sql server - Generating XML with T-SQL -


I am starting to use XML in my TSQL queries.

Will generate the SQL

following.

  & lt; SampleXML & gt; & Lt; Color & gt; & Lt; Color name = "white" /> & Lt; Color name = "blue" /> & Lt; / Color & gt; & Lt; Fruit & gt; & Lt; Fruit name = "apple" /> & Lt; Name of fruit = "pineapple" /> & Lt; / Fruit & gt; & Lt; / SampleXML & gt;  

After

You are probably looking for "XML for T-SQL" / P>

Returns results as a search query rows By alternatively specifying the XML clause in the query, you optionally retrieve the formal results of the SQL query as XML You can. Can be used in top-level questions and sub queries for XML section. The top level for the XML clause can only be used in the selection statement. In sub queries, XML can be used for INSERT, UPDATE, and DELETE statements. It can also be used in the assignment statement.

Take a look at this site too


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -