DTS & SP Raise Errors

  • One of my steps in my DTS package fires off a stored procedure. I do some error handling within the SP. How can I see the error that I raise? It isn't in the output file. Is there a way of getting this out or do I need to use another strategy?

    Thanks,

    John

  • I would simply create an error log table and put your errors in it (make sure to roll back transactions BEFORE writing to the log table!), use something like xp_cmdshell to write to a text file, or add an entry to the event log.

    At one time or another I have done all three of these depending on the situation. Personally I prefer the first option as I always forget to look at the event logs (I'm a developer first, dba second). And having to go to a text file is just not something I like to do. 🙂

    Gary Johnson

    Microsoft Natural Language Group

    DBA, Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • I have a similar situation. I have an error when my stored proc inserts a character into a tinyint field within a transaction. Even I have an error handler in the stored proc, The SQL server rolled back the transaction without going to my error handler.

    Any idea?

    Thanks

    Joseph

  • The best way I can think of is to check for the error before the insert and then manually roll back and then log the error.

    Gary Johnson

    Microsoft Natural Language Group

    DBA, Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply