Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 @idoc

Author  Topic 

X002548
Not Just a Number

15586 Posts

Posted - 2007-06-28 : 15:14:43
So, I created spome sprocs using OPENXML

63 ms transaction length..not too shabby

BUT!

I prepared 2 documnets and forgot to do sp_xml_removedocument duiring the exit of the sproc

Have have since fixed that, but I've left 2 documents in memory, and with out know idoc, I don't know how to remove them

Anyone have any ideas how to "see" all the prepared docs in memory and/or (and more importantly) the id

I've been pouring over google and bol but no joy



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-06-28 : 16:01:49
how big were the xml blobs in the documents? if not enormous I wouldn't worry about it - are you experiencing memory pressure on this server?

in any case they will get cleaned up next time you cycle the service.


elsasoft.org
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-06-28 : 16:12:42
quote:
Originally posted by jezemine

how big were the xml blobs in the documents? if not enormous I wouldn't worry about it - are you experiencing memory pressure on this server?

in any case they will get cleaned up next time you cycle the service.


elsasoft.org



No there are small...and yes I know that it get cleaned up on reboot..but I mean, there gotta be a way...

Booting the server is the only way?

There's some hell of a design



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-06-28 : 17:24:01
reboot should not be necessary - just restarting the service.

but I wouldn't sweat it if the docs were small. Just leave them there and they will get cleaned up next time you cycle.


elsasoft.org
Go to Top of Page

sshelper
Posting Yak Master

216 Posts

Posted - 2007-06-28 : 17:31:00
According to Books Online:

"sp_xml_preparedocument returns a handle that can be used to access the newly created internal representation of the XML document. This handle is valid for the duration of the connection to Microsoft® SQL Server™ 2000, until the connection is reset, or until the handle is invalidated by executing sp_xml_removedocument."

So once your connection is closed, the document is removed from memory.

Also, from Books Online:

"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."

Since it's stored in internal cache, I believe there's no way of retrieving it again. All you have to do is close your connection and the document is gone.

SQL Server Helper
http://www.sql-server-helper.com
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-06-28 : 18:43:08
ah, good find.


elsasoft.org
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-06-29 : 09:13:58
So once the spid is done, the docs are gone?

Just like temp tables?

Or are we talking about something different?

In any case, making sure to cleanup in any event would be important

Thanks for the info



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

sshelper
Posting Yak Master

216 Posts

Posted - 2007-06-29 : 10:25:33
Based on the description, I believe it is similar to temp tables. Once you close your connection, the documents gets cleaned up.

SQL Server Helper
http://www.sql-server-helper.com
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-06-29 : 10:49:10
Ya know, Kalen's Inside SQL Server 2000 doesn't even mention OPENXML Architecture..or maybe I missed it

In any case, I waas worried about performance, but it really does fly


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-06-29 : 11:44:57
"In any case, I waas worried about performance, but it really does fly"

It won't once (if) the XML gets large.

We were using that route for XML that was 2MB+ big, It was slow (tens of minutes IIRC). We moved to the SQLXMLBulkLoad COM object and that is seriously fast by comparison (minutes-turned-to-milliseconds).

Kristen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-06-29 : 13:07:56
Got some sample code?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-06-29 : 13:49:22
"Got some sample code?"

I've got some VBScript that you are welcome to.

Send me a private message offline, and I'll attach the files.

Gotta run now, off out to dinner tonight, but I will be around Saturday morning - if hangover not too bad!

Kristen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-07-09 : 14:32:58
I can't find SQLXMLBulkLoad in BOL



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-07-09 : 14:58:27
Nah, not in BoL 'coz its a separate COM object.

These may help:

http://sqljunkies.com/Article/650DF949-148D-46B3-9156-6783646F976D.scuk

and this one:
http://msdn2.microsoft.com/en-us/library/aa225730(sql.80).aspx
gawd knows why they have to put ( ) in their URLs ... you're gonna have to Cut&Paste that one And watch out as MS will probably have uprated all its DOCs to SQL2005 and dumped all the earlier version SQL2000 stuff. Principal is the same though.

Send me a P.M. if you want a copy of my little VBScript thingie

Kristen
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-07-10 : 11:34:50
"sp_xml_preparedocument returns a handle that can be used to access the newly created internal representation of the XML document. This handle is valid for the duration of the connection to Microsoft® SQL Server™ 2000, until the connection is reset, or until the handle is invalidated by executing sp_xml_removedocument."

This tells me that the HANDLE is valid until the connection closes. I don't see where the document itself is removed on closing the connection. I read the handle as a pointer to the object. I could be wrong, it HAS happened before

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -