I’m using FOR XML to create an XML file out of SQL queries. I want to have elements based around common values for a particular column, in this case “location”: I can easily convert his into XML row-by-row like so: Which produces XML that looks liks this: But what I actually want is this: Answer You can use an ad
Tag: for-xml
SQL – FOR XML – How to add property to tag
I have the a stored procedure to generate an XML document based on the UBL-TR-2.1 standard. This is the query where the xml data is generated: A sample output of this query is this XML file: This works so far so good. But now some XML elements shall have attribute in the element itself. One example is: How can I