We are using a ET data extension where one of the fields stores an XML file from our external API. We have to extract the values and parse them to assign for each parent/child contained within the variable. How can we build the rowset for each parent and child while continuing to loop through each value? Here's the file structure and current build:
DECLARE @xml xmlSET @xml ='<Schema><Message><HOH><HOHID>49</HOHID><LastName>Jones</LastName><FirstName>William</FirstName><ContactType>EMAIL</ContactType><ContactValue>email@email.com</ContactValue></HOH><Patient><PatientId>55</PatientId><LastName>Jones</LastName><FirstName>Samuel</FirstName><AppointmentDateTime>12/5/2014 10:00:00</AppointmentDateTime><ClinicId>41</ClinicId><AppointmentTypeCode>1</AppointmentTypeCode><AppointmentSubTypeCode></AppointmentSubTypeCode></Patient><Patient><PatientId>66</PatientId><LastName>Jones</LastName><FirstName>Allison</FirstName><AppointmentDateTime>12/5/2014 10:45:00</AppointmentDateTime><ClinicId>41</ClinicId><AppointmentTypeCode>1</AppointmentTypeCode><AppointmentSubTypeCode></AppointmentSubTypeCode></Patient></Message>
set @rowset = BuildRowsetFromXml(@xml, "//HOH", 1) set @HOHId = Field(Row(@rowset, 1), 'HOHID')