Table saved as XML data file

  • I did not do all my homework and is totally new to XML, but would like to know how to get the results of "select name,number,detail from mytable" into a "mytable.xml" (text) file with all the correct headers, roots and structure etc.  A client requested the data normally sent as a delimited text file to be in XML.  "select * from mytable for xml auto,elements" sounds like an option, but I'm battling. (I used to 'cut-a-paste' the (small) results from query analyzer into a file). I appreciate the help.

  • SELECT name,number,detail from mytable for XML AUTO

    This will produce an XML fragment for the data but not the root node.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply