I want to create an xml node that contains attributes as well as values.
Example:
<mynode attr1="hello">world</mynode>
I understand that
SELECT 'hello' as '@attr1'
creates at least mynode, but how to attach "world" then?
I tried
SELECT 'world' as 'mynode/[@attr1=hello]'
but it didn't work
This is a basic example:
Please, for more information you can visit this page SQL SERVER – Simple Example of Creating XML File Using T-SQL
This helps you
The following script enables you to extract all your data from all tables in your database into a single XML file: