Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need XML query

Author  Topic 

jyothi_jayanth
Starting Member

7 Posts

Posted - 2009-09-30 : 19:27:08
Hi I have some tables like below

Reservation
------------
ReservationID
AccountID
PassengerID

ReservationLocations
-------------------
ReservationID
LocationType
Address
City
State
Country

Reservation Charges
-------------------
ReservationID
ChargeType
Amount

AccountMaster
------------
AccountName
Phone
Email

PassengerMaster
--------------
PassngerName
PassngerPhone
PassengerEmail

so i need to generate one single XML with below format

<Reservations>
<Reservation>
ReservationID="1234"
<AccountDetails>
AccountName = "XYZ"
Email = "Test@email.com"
</AccountDetails>
<PassngerDetails>
PassngerName = "yyy"
Email = "Test@email.com"
</PassngerDetails>
<Locations>
<Location>
LocationType = "PickUp"
Address = "XYZ"
</Location>
<Location>
LocationType = "Drop-Off"
Address = "YZC"
</Location>
</Locations>
<Charges>
<Charge>
ChargeType ="Base Rate"
Amount = "100.30"
</Charge>
<Charge>
ChargeType ="Base Rate"
Amount = "10.30"
</Charge>
</Charges>
</Reservation>
-----
-----
</Reservations>

please help me in building the above XML query

your help is greatly appreciated

Thanks in advance


Jayanthu Babu gadde

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-09-30 : 20:25:36
Dupe:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=133728
Go to Top of Page
   

- Advertisement -