Hello all,
I have select statement as below:
SELECT * FROM @CustomerInfo AS CustomerInfo
INNER JOIN @CustAccountInfo AS CustAccountInfo
ON CustomerInfo.RegistrationID = CustAccountInfo.CustomerID
INNER JOIN @CreditInfo AS CreditInfo
ON CreditInfo.CustomerID1 = CustomerInfo.RegistrationID
INNER JOIN @CreditInfoExtention AS CreditInfoExtention
ON CreditInfoExtention.CustomerID2 = CustomerInfo.RegistrationID
FOR xml auto, elements
When I get XML file its not like what I want. The elements are nested.
<CustomerInfo>
<Details>Hello</Details >
<CustAccountInfo>
<Details>Hello</Details >
<CreditInfo>
<Details>Hello</Details >
<CreditInfoExtention>
<Details>Hello</Details >
</CreditInfoExtention>
</CreditInfo>
</CustAccountInfo>
</CustomerInfo>
What i want is all the <Details>Hello</Details >
elements under single node. Please Advise.