Shred XML Data into Columns/Rows
- From: Ganesh Muthuvelu <GaneshMuthuvelu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 25 Nov 2008 15:30:02 -0800
Hello,
I have a XML as below. As you may see, the ErrorMessage node has several
"Error" nodes with attributes and data. Now, I want to get those attribute
names as "columns" and the values in "rows".. (Action, Key, MultiRefId,
Batch... are the columns).
Can someone help me to get this using SQL Server XML capaiblities?. Thanks.
******************
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddPartitionResponse xmlns="http://xyz.com/WebServices/">
<AddPartitionResult>
<Success>false</Success>
<NumberOfBatches>1</NumberOfBatches>
<NumberOfEntities>2</NumberOfEntities>
<RecordsAffected>0</RecordsAffected>
<XmlRequestID>169</XmlRequestID>
<ResponseMessage>Request executed but with errors</ResponseMessage>
<ErrorMessage>
<Error Action="AddPartition" Id="2" Key="MCL_12" MultiRefId="id2"
Batch="1/1" Status="Failed"
FaultCodeNamespace="http://schemas.xmlsoap.org/soap/envelope/"
FaultCodeException="Server.generalException">ERR_REC_EXISTSFailed </Error>
<Error Action="AddPartition" Id="1" Key="MCL_11" MultiRefId="id1"
Batch="1/1" Status="Failed"
FaultCodeNamespace="http://schemas.xmlsoap.org/soap/envelope/"
FaultCodeException="Server.generalException">ERR_REC_EXISTSFailed </Error>
</ErrorMessage>
</AddPartitionResult>
</AddPartitionResponse>
</soap:Body>
</soap:Envelope>
******************
.
- Follow-Ups:
- Re: Shred XML Data into Columns/Rows
- From: Joe Fawcett
- Re: Shred XML Data into Columns/Rows
- Prev by Date: RE: Can I use ../@mp:localname?
- Next by Date: Re: insert binary data from xml
- Previous by thread: Multiple XML insert using SQL Server 2008 DML and Correlated Where subquery?
- Next by thread: Re: Shred XML Data into Columns/Rows
- Index(es):
Relevant Pages
|