Convert select query result to XML format in SQL Server -


this question has answer here:

i trying convert result xml format using stored procedure code below

select      k.keyword result       searchkeyword k       k.keyword @searchword + '%'    xml path 'root', binary base64) 

but return below

<root>    <result>1</result> <root>  <root>    <result>2</result> <root> 

but need result below remove 1 root element

<root>     <result>1</result>     <result>2</result>     .     .     . </root> 

anyone please help

select k.keyword result  ... k ... xml path(''), root('root'), binary base64 

sql fiddle demo


Comments