Professional Web Applications Themes

How to unload processes when constraint errors happen - Microsoft SQL / MS SQL Server

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_RemoveDoent 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_RemoveDoent gets called when a constraint raises the error? Thanks in advance, /Ty...

  1. #1

    Default How to unload processes when constraint errors happen

    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_RemoveDoent 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_RemoveDoent gets
    called when a constraint raises the error?

    Thanks in advance,
    /Ty



    Ty Guest

  2. #2

    Default Re: How to unload processes when constraint errors happen

    One way is to check the error variable after every sql statement and then
    call sp_xml_removedoent.

    --
    Dean Savovic
    [url]www.teched.hr[/url]


    "Ty" <tybala on the server at hotmail.com> wrote in message
    news:e#Cu5k1PDHA.304tk2msftngp13.phx.gbl...
    > 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_RemoveDoent 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_RemoveDoent gets
    > called when a constraint raises the error?
    >
    > Thanks in advance,
    > /Ty
    >
    >
    >

    Dean Savovic Guest

Similar Threads

  1. Why does this happen?
    By susie+q in forum Macromedia Flash Player
    Replies: 0
    Last Post: October 21st, 01:58 PM
  2. what happen with msconfig???
    By Default User in forum Windows Vista
    Replies: 4
    Last Post: March 9th, 06:30 PM
  3. What will happen to OpenServer...
    By brian in forum SCO
    Replies: 6
    Last Post: September 10th, 12:27 AM
  4. I don't understand why this happen
    By Li Ngok Lam in forum PERL Beginners
    Replies: 3
    Last Post: August 18th, 02:09 PM
  5. Unique constraint
    By Aaron Bertrand - MVP in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 8th, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139