Re: Modify in a large xml file

Tech-Archive recommends: Speed Up your PC by fixing your registry



Since you do it on a variable, I assume that the processing parses the whole
XML document into the internal node table, then executes the update and
writes the data back...

Depending on the size and structure you may be better off with having it in
a temp table with an index or doing it inside the CLR.

Best regards
Michael

"blam" <bendlam@xxxxxxxxx> wrote in message
news:1173476464.372601.230830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have an sp that takes an xml data type.

When I do something like

SET @Xml.modify('
replace value of (/schedule/RevisionNumber/text())[1]
with sql:variable("@CurrentRevNo")

it seems to do alot of reads and slows performance.

My question is does the SQL Server load the entire XML file in memory
then replace the value?

Do you think it would be better to pass the XML into a CLR function
that would use a SAX parser to modify the value and pass it back to
the sp?



.



Relevant Pages

  • Re: Fastest way to move XML document into and back out of CLR function
    ... the fastest way to move an XML document into and out of a CLR function is to just send an XmlDocument. ... SQL Server isn't going to let you do that outright. ... You might be able to get away with declaring the stored procedure as an output parameter, but I don't know if the xml type can be passed in then. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: complex - split string in sql - need help
    ... a CLR function is a good way to do this. ... However, that data looks awfully similar to XML, so if you could play ... UNION ALL ...
    (microsoft.public.sqlserver.programming)
  • Re: value error when parsing XML
    ... Ajay Brar wrote: ... > executes fine when the xml and dtd files are in user/. ...
    (comp.lang.python)
  • Problem with XmlTextWriter
    ... It's currently failing with an InvalidOperationException when it ... executes the xw.WriteStartElementfor the second time. ... in an invalid XML document." ...
    (microsoft.public.dotnet.xml)