All views and opinions are personal opinions of the Hosk

Today I found some functionality which I thought was amazing and will save me loads of time creating some sample XML files to test my webservice with.

I had some sample data in database which I wanted to convert into an XML file.

My original idea was to use excel to concatenate bits of it but this turned out to be to slow and difficult. I then found out that SQL Server has in built functionality to convert sql statements into XML files.

This article goes through some of the functionality and I would also read this article if you want more detail than my example below

Thanks for the tip. I am borrowing this for a sql query which needs to have it’s information converted to XML to send to another vendor. However, how do you get the FROM clause to work if you’re or calling multiple tables?

I noticed that you have everything in quotations after each of the pieces of the SELECT statement, but nothing around the salesperson designation trailing the FROM clause. I’m assuming that it will work the same way with a JOIN as it does without it above.