- Mar 1, 2000
- 30,890
- 5,001
- 126
I'm trying to learn SQL and XML (more or less at the same time) and I am stuck on a query at this point.
the end of my query looks as so:
FOR XML PATH('DebtRecord'), TYPE, ELEMENTS, ROOT
and technically the results are OK. creating 1 <root> which encloses multiple <DebtRecord> values all at the same level.
However in the XML format I have to match, between the <root> level and the <DebtRecord> there is another value <TRIPHeader> that is of the same level as <DebtRecord>... however there will be only 1 <TRIPHeader> value, compared to 100s of <DebtRecords>. Does that make sense?
I can not figure out how to get that single <TRIPHeader> to populate in my results file at all.
the end of my query looks as so:
FOR XML PATH('DebtRecord'), TYPE, ELEMENTS, ROOT
and technically the results are OK. creating 1 <root> which encloses multiple <DebtRecord> values all at the same level.
However in the XML format I have to match, between the <root> level and the <DebtRecord> there is another value <TRIPHeader> that is of the same level as <DebtRecord>... however there will be only 1 <TRIPHeader> value, compared to 100s of <DebtRecords>. Does that make sense?
I can not figure out how to get that single <TRIPHeader> to populate in my results file at all.