adding an attribute to xml root in sql server -


i trying create xml sql server , done query. but, have problem couldnt figure out. how can add attribute root "item", not "items"? sql query below...

select               card_type             ,code             ,name             ,unitset_code             ,auxil_code             ,auxil_code2             ,auxil_code3             ,auxil_code4             ,auxil_code5             ,cyphcode        p_items       hostgroupid='7155d850-5882-43a0-b722-f6586bfffa61'         , trancode ='items'         , processed ='new'         xml path('item'),root('items') 

try this

select           'theattributvalue' [@myattribut]         ,card_type         ,code         ,name         ,unitset_code         ,auxil_code         ,auxil_code2         ,auxil_code3         ,auxil_code4         ,auxil_code5         ,cyphcode    p_items   hostgroupid='7155d850-5882-43a0-b722-f6586bfffa61'     , trancode ='items'     , processed ='new'     xml path('item'),root('items') 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -