all groups > sql server programming > june 2003 >
You're in the

sql server programming

group:

How to unload processes when constraint errors happen


How to unload processes when constraint errors happen Ty
6/30/2003 3:44:58 PM
sql server programming:
Hi all,

I am shredding really large XML files into SQL via SP_XML_PrepareDoc. I do
a lot of internal error handling within the SPROC, and I always call
SP_XML_RemoveDocument before I call RAISERROR.

While this is great for ensuring I do not use up precious RAM for
RAISERRORS, how would I go about ensuring that SP_XML_RemoveDocument gets
called when a constraint raises the error?

Thanks in advance,
/Ty


Re: How to unload processes when constraint errors happen Dean Savovic
7/1/2003 10:06:24 AM
One way is to check the @@error variable after every sql statement and then
call sp_xml_removedocument.

--
Dean Savovic
www.teched.hr


[quoted text, click to view]

AddThis Social Bookmark Button