Professional Web Applications Themes

how to get the error message in a stored proc - Microsoft SQL / MS SQL Server

Hi, have a stored proc where i check error for some actions. Now when something goes wrong i want to write this in a log. So how can i get the full error message which is shown for example in the query yzer under "messages" ? thanks, Helmut...

  1. #1

    Default how to get the error message in a stored proc

    Hi,

    have a stored proc where i check error for some actions.
    Now when something goes wrong i want to write this in a log.
    So how can i get the full error message which is shown for example
    in the query yzer under "messages" ?

    thanks,
    Helmut




    Helmut Guest

  2. #2

    Default Re: how to get the error message in a stored proc

    For a detailed understanding, refer to Erland's articles:
    http://www.algonet.se/~sommar/error-handling-I.html
    http://www.algonet.se/~sommar/error-handling-II.html

    --
    - Anith
    ( Please reply to newsgroups only )


    Anith Guest

  3. #3

    Default Re: how to get the error message in a stored proc

    thanks for your procedure to get the message text. It is not working in
    the moment, i always get an empty string. Checked the content of
    temporary table #a and it looks good. Must step a little deeper in it,
    im am not sure how the procedure works and so i don't know if the
    offsets are okay. By the way, i am using MSDE 2000. One thing i found
    out is, that i can't get every error. If severity is 16 or more then no
    luck to capture it in the same stored proc (tested: wrong value for
    datetime field - using a number is severity 14, using string 'A' is
    serverity 16). Any idea to catch it?

    bye,
    Helmut


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Helmut Guest

Similar Threads

  1. Calling webservice from within a stored proc 407 error...
    By Doug in forum ASP.NET Web Services
    Replies: 0
    Last Post: September 15th, 09:18 PM
  2. EXEC in TSQL stored proc causes ERROR
    By don schilling in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: September 29th, 09:06 PM
  3. returning values from stored proc error!
    By Harag in forum ASP Database
    Replies: 5
    Last Post: September 13th, 03:11 PM
  4. SQL / Stored proc help
    By vf in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: July 30th, 07:07 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