I need to write the result of a query in an XML through a job that will run daily scheduled in SQL Server. The procedure already returns the result in XML format with tags, in a variable. I just need to play the contents of this variable in XML. What is the best way to generate this XML? How do I define the path that the XML will be written to and how do I define the file name?
Thanks!