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
 General SQL Server Forums
 New to SQL Server Programming
 generate xml using sql query

Author  Topic 

jimoomba
Yak Posting Veteran

90 Posts

Posted - 2012-04-10 : 08:43:37
Hi All,

I want to generate an xml using the below tables using sql query(sql 2008) in the following format :

<SubmitMessage version="B000">
<Authentication id="57985775">AYUPXNHD</Authentication>
<ForwardMessage category="data">
<AdC>4799982</AdC><AlertCode>3</AlertCode>
<MessageData infotype="15">0A06420006C02002010100C3</MessageData>
<Flags ack="1" />
</ForwardMessage>
</SubmitMessage>

Here are the three tables and its data in detailed format

table1:

ControlStationID Password
57985775 AYUPXNHD

table2:

ID TerminalID Type
1 4799982 1

table3:

ID MessageData
1 0A06420006C02002010100C3
2 0B06420007C02002020300C3


kindly help me on the same

Thanks

rams

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-04-10 : 15:26:18
how are tables related? without any relation what sense does it make to merge details from them in same xml document?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -