Re: Putting attribute on root node using FOR XML PATH
Posted by markc600 on 05/17/06 11:52
Try using a nested query instead
select
m.msgid '@msgID',
(
select st.namelong '@namelong',
st.nameshort '@nameshort'
from settable st
where st.setid = m.setid
for xml path('set'),type)
from
msgset m
where m.msgID = 195
for xml path('message'), type