SQL – Select into XML structure

from imp_dataSource d
join def_mapping m on m.sup_propertyCode = d.sup_propertyCode
where m.sup_familyCode = d.sup_familyCode or m.sup_familyCode ='GENERIC'
and m.map_type in ('SIMPLE', 'COMPLEX')
and d.sup_propertyValue != '' and d.sup_propertyValue is not null
order by d.sup_familyCode, d.sup_productCode, d.sup_propertyCode
for xml auto, type, elements, root('Products')

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: