本文介紹了將兩個xml片段合并為一個?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
如何將@a
和@b
的xml內容合并成@c
?
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 ....?
我需要將合并的 xml 傳遞給存儲過程.
I need to pass the merged xml to a stored procedure.
我知道可以將 xml 轉換為 varchar 并連接它們并將其轉換回 xml.有什么更好的方法嗎?xml 內容可能很大.
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.
推薦答案
好的,我找到了一種方法
OK, I found one way
select @a, @b for xml path ('')
這篇關于將兩個xml片段合并為一個?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!