• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

Creating XML via SQL Server and receive error with larger dataset

When running with less than 25,000 records the XML generation runs fine but when the data set exceeds 25K records I get this error.  Does anyone have an idea why this might be.  The location in the procedure that is said to fail changes in direct relationship to the amount of data being processed.  The structure  of the XML is as below.
<Branches>
    <Branch>
       <Stock>
          <Item Attributes..../>
          <Item Attributes..../>
       <Despatch>
          <Item Attributes..../>
          <Item Attributes..../>
          <Item Attributes..../>
       </Stock>
    </Branch>
</Branches>

Open in new window


Sometimes it fails at in Stock sometimes in Despatch.  

Msg 6833, Level 16, State 1, Procedure PI_AppendTransmissionTable_V2, Line 51
0
Alyanto
Asked:
Alyanto
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I fear I have bad news in regards to that the MS XML components are not really good for very large XML ... you will need to generate the XML outside of SQL...
listening ...
0
 
Anthony PerkinsCommented:
Please post the relevant section of your code, but I suspect Guy is right on this.
0
 
AlyantoAuthor Commented:
Thanks Guy, I believe you have confirmed what I feared.  At 25k records with 4 nesting levels size is propabably the issue.  I have gone for a scripting solution  and to be honest the performance on the same data with the same structure is a vast improvement.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now