How to convert records in a table to xml format using T-SQL?

Viewed 101288

I've got a simple table and want to store its content into a xml on the harddrive. There should be one root element for the whole table, one element per table row and one child element per table column.

What possibilities do I have?

Thanks a lot Tomas

3 Answers

SELECT CAST('1' AS XML)

This Query fire in sql and your copy data put inside then show XML Result.

Related