How to merge the xml content of @a
and @b
into @c
?
declare @a xml = (select 1 aaa for xml path('AAAs'));
declare @b xml = (select 1 bb1, 2 bb2 for xml path('BBBs'));
declare @c xml = ... @a + @b ....?
I need to pass the merged xml to a stored procedure.
I know it's possible to cast the xml to varchar and concat them and convert it back to xml. Any better approach? The xml content can be big.
How to merge the xml content of @a and @b into @c ? declare @a xml = (select 1 aaa for xml path('AAAs')); declare @b xml = (select 1 bb1, 2 bb2 for xml path('BBBs')); declare @c xml = ...
A complete toolkit for reliably merging multiple XML documents or datasets into a single file. XML Merge analyses the structure of your XML files to identify differences and apply sophisticated rules for automated merging.
OK, I found one way
select @a, @b for xml path ('')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With