Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Querying XML files using SQL 2000 Expand / Collapse
Author
Message
Posted Wednesday, October 9, 2002 12:00 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:32 AM
Points: 2,905, Visits: 1,825
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/dpoole/queryingxmlfilesusingsql2000.asp

LinkedIn Profile
Newbie on www.simple-talk.com
Post #7327
Posted Thursday, October 10, 2002 3:24 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:32 AM
Points: 2,905, Visits: 1,825
Oh the embarrassment!!!!

Thanks to Carsten Dauguaard for spotting it.

In the code for the stored procedure

exec sp_xml_preparedocument @iDocumentHandle OUTPUT, @stdoc

should be

exec sp_xml_preparedocument @iDocumentHandle OUTPUT, @stXML

This is what you get when you copy a stored proc into Word, save it as html then edit the html in notepad!



LinkedIn Profile
Newbie on www.simple-talk.com
Post #43408
Posted Thursday, October 10, 2002 3:26 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:32 AM
Points: 2,905, Visits: 1,825
Oh the embarrassment, thanks to Carsten Dauguaard for spotting it.

exec sp_xml_preparedocument @iDocumentHandle OUTPUT, @stdoc

should be

exec sp_xml_preparedocument @iDocumentHandle OUTPUT, @stXML





LinkedIn Profile
Newbie on www.simple-talk.com
Post #43409
Posted Monday, October 14, 2002 2:18 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 31, 2007 8:20 AM
Points: 885, Visits: 1
Great article !




Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Post #43410
Posted Monday, October 14, 2002 2:21 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 31, 2007 8:20 AM
Points: 885, Visits: 1
Hi

One question:

WARNING: - This will use 1/8th of the memory available to SQL Server.

So, we open up 10 4kb documents it will do what to memory?? and what memory structure are we talking about?

Cheers

Ck




Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Post #43411
Posted Monday, October 14, 2002 3:14 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:32 AM
Points: 2,905, Visits: 1,825
Books on line says "A parsed document is stored in the internal cache of SQL Server 2000. The MSXML parser uses one-eighth the total memory available for SQL Server. To avoid running out of memory, run sp_xml_removedocument to free up the memory.".

Although it makes reference to the XML Parser but it is not crystal clear whether this means there is a 1/8th penalty overall for using the XML parser or 1/8th per document.

I haven't had chance to test it in anger because the CMS we are developing on has a memory leak (more of a terminal gush) in its implementation of DOM so I've had to revert to itterating through a normal recordset building up the XML as a text string.

Which ever scenario is used the guideline I would suggest is to use the sp_xml_removedocument as soon as humanly possible.



LinkedIn Profile
Newbie on www.simple-talk.com
Post #43412
Posted Wednesday, January 14, 2004 6:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 30, 2004 12:41 PM
Points: 1, Visits: 1
great article but my question is: where do you specify the pad to your XML file
Post #95089
Posted Wednesday, January 19, 2005 9:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 12, 2014 7:29 AM
Points: 1, Visits: 31

What do we  do if the XML to be processed is more than 8000 characters? Do we wait for SQL Sever 2005 for next generation of XML- SQL usage?




Post #156468
Posted Monday, April 2, 2007 7:01 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, August 21, 2014 12:21 PM
Points: 117, Visits: 572

In case anyone is still watching this thread...

I come from the "validate all input" school, especially when a "blind" SP is called from who knows where.  Does anyone have any guidance in SS2K on validating the elements in the document before hitting an exception for a "bad date" or "number too large for destination data type" issue?  I've worked out a really clunky way using OPENXML into nvarchar fields, then validate, then parse again into typed fields when the entire doc is valid, but there must be something better

Post #355497
Posted Wednesday, January 16, 2008 6:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, January 17, 2008 9:43 PM
Points: 1, Visits: 2
where do i store XML file
Post #443567
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse