View Thread
 Print Thread
Selecting data as XML
admin
Simple example on how to select normal rows as xml:


SELECT  TOP 10
        Pat_ID AS "Pat_ID" ,
        Pat_Title AS "Name/Title" ,
        Pat_Firstname AS "Name/First" ,
        Pat_Middlename AS "Name/Middle" ,
        Pat_Surname AS "Name/Surname" ,
        Pat_Landline AS "Contact/LandLine" ,
        Pat_Mobile AS "Contact/Mobile" ,
        Pat_email AS "Contact/Email" ,
        Pat_Add1 AS "Address/Address1" ,
        Pat_Add2 AS "Address/Address2" ,
        AREA_TXT AS "Address/Town" ,
        Pat_PostalCode AS "Address/PostCode"
FROM    tbl_Patient
FOR     XML PATH('PatientRecord') ,
            ROOT('tbl_Patient')

Jordon Pilling | Heavencore Administrator
 
Jump to Forum