私はのようなものが必要です
select * from tb_listings for xml auto
ただし、1つの大きなxmlドキュメントではなく、すべての行を分離する必要があります。
私は次のようなことを試しました:
select id, (select * from tb_listings a where a.id=id for xml auto) as xmldata from tb_listings
期待される出力は次のようになります。
id xmldata
------------------------------------------------------------
1 <listing><name>ABC</name><xyz>123</xyz></listing>
しかし、それは私が望むことをしていないようであり、実行するのにも非常に長い時間がかかります。
任意のアイデアをいただければ幸いです。:)
編集:それを理解しました:
select id, (select top 1 * from tb_listings a where a.id=b.id for xml auto) from tb_listings b
閉鎖。