Skip to content
Advertisement

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 add the schemeID attribute with its value into my query?

Thanks for any help in advance!

Advertisement

Answer

Add this column before your cbc:ID

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement