I am trying to generate this
<Mail>
<Field key="SenderName" value="someone" />
<Field key="RecipientName" value="someone else" />
<Mail/>
<Mail>
<Field key="SenderName" value="another someone" />
<Field key="RecipientName" value="another someone else" />
<Mail/>
heres the test data
declare @tab table (SenderName varchar(255), RecipientName varchar(255))
insert @tab
select 'someone' , 'someone else' union
select 'another someone' , 'another someone else'
I have tried various things with for xml path but I cant work out how to tell declare that I want a new element of the same name after recipient name.
thanks,