vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| It's not clear exactly what the issue is - your procedure should continue after a constraint violation (unless perhaps there are triggers involved), so you should be able to check @@ERROR and call sp_xml_removedocument or do something else based on that. But you didn't mention exactly which error you are seeing, so it's not easy to say for sure. If that doesn't help, perhaps you could post the error message and some sample code to clarify where your error occurs and how you are trying to handle it? Simon "Ty" <tybala at the server on Hotmail dot com> wrote in message news:d98287e8aa3bf5659692b92ee830b6aa@free.teranew s.com... > 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 > > > |
| ||||
| Hmm.. That is definately a step in the right direction. I will conditional around @@error for some of my updates. I am not getting any particular error messages right now; it is just that my XML may be dirty sometimes, and we use an infrastructure of coditionals and constraints to ensure data integrity. Any constraint voilations would cause the remainder of the SPROC to crash, thus rolling back the transaction. I am concerned that memory would be locked if the SPROC crashed prior to a proper unloading of XML_Preparedoc. Thanks for your assistance; I am sure with properly targeted checks on @@error I will cover nearly all real world scenarios. /Ty "Simon Hayes" <sql@hayes.ch> wrote in message news:3f01789b$1_5@news.bluewin.ch... > It's not clear exactly what the issue is - your procedure should continue > after a constraint violation (unless perhaps there are triggers involved), > so you should be able to check @@ERROR and call sp_xml_removedocument or do > something else based on that. But you didn't mention exactly which error you > are seeing, so it's not easy to say for sure. > > If that doesn't help, perhaps you could post the error message and some > sample code to clarify where your error occurs and how you are trying to > handle it? > > Simon > > "Ty" <tybala at the server on Hotmail dot com> wrote in message > news:d98287e8aa3bf5659692b92ee830b6aa@free.teranew s.com... > > 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 > > > > > > > > |