Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
i want to create xml from a table, with a sturcture like :<root> <a> <x>dd</x> <y>dd</y> </a> <a> <x>23434</x> <y>dfgfgd</y> </a></root>how do i do it?ThanksPeleg
acd
Starting Member
6 Posts
Posted - 2009-10-06 : 11:44:53
Hi,
select x,y from ( select x='dd', y='dd' union all select x='23434', y='dfgfgd' ) a for xml auto, elements, root('root')
Regards,Bartek
pelegk2
Aged Yak Warrior
723 Posts
Posted - 2009-10-06 : 15:39:03
Thanks.is there a way i cant put the result into a variable likeDecalre @myXml nvarchar(1000)?