Retrieveing DB Values in XML Format using XML AUTO
XML AUTO:
The main aim is to the Output data from the sql query will be in the XML Format.
XML AUTO option labels each element with either the table name that the data source is from. If there is data output from more than one table, then the data from each table is split into seperate, nested elements.
use northwind
select Customers.Customerid, Customers.Companyname, Orders.Orderid, Orders.Orderdate
from Customers
join Orders
on Customers.Customerid = Orders.Customerid
where Customers.Customerid ='ALFKI'
for xml autoOutput:
<Customers Customerid="ALFKI" Companyname="Alfreds Futterkiste"><Orders Orderid="10643" Orderdate="1997-08-25T00:00:00"/><Orders Orderid="10692" Orderdate="1997-10-03T00:00:00"/><Orders Orderid="10702" Orderdate="1997-10-13T00:00:00"/><Orders Orderid="1083