On Error () Logging by Using Event Handlers

  • Comments posted to this topic are about the item On Error () Logging by Using Event Handlers

  • Nice article and a good companion to Jamie Thompsons blog at conchango:

    http://blogs.conchango.com/jamiethomson/archive/2005/06/11/SSIS_3A00_-Custom-Logging-Using-Event-Handlers.aspx

    I see you followed the same development path as I had - generalise the error logging and then the same principle can be applied to all SSIS packages in production. This leaves you with a consistant process log table which can be used for system reporting.

    Handy when you want to run a quick report in the morning to check on the status of all the overnight jobs 🙂

  • Is there a particular reason you don't use the built-in logging?

  • It gives u more customization on logging mechanism. Here I mentioned a simple example, u can use ur own ideas for a more complex logging.

    Thanks for ur comments

  • Hi Arun, Following your steps exactly as provided doesn't work. The Expressions Editor Query produces a cannot be parsed error message.

  • Hi… I checked the Expression thoroughly and it is working perfectly.

    Please check the user variable, may be u didn’t created the user variable named @[User::PackageLogID].

    If u have created the above variable perfectly, then please send me the detail of the error message that u got.

    Thank u

  • Hello Arun, brilliant! you're 100% correct. I just had to get up to speed on creating user variables. Thanks much Arun! You helped me learn something today!

  • Just a quick question... I don't see where the column called "PrcocedureName" in the error log table is either described or used in the article. Is it just an unused, mispelled artifact?

    Other than that, pretty cool article on simple error logging.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • The column named “[PrcocedureName]” can be used to detect the procedure that causes the particular error. But I didn’t implement it in the methodology; the user can implement it in case if they are using some procedures in the ETL process. The details about implementing the same will be posted in my next article.

    Thank you

  • Is it possible to add Cointainer Name along with Package Name & Task Name. I think its little bit tircky

  • Yah it’s possible, I will try to find out some direct ways to do it. But for the time being, you can use one custom task to keep track of the currently executing container in a variable and can add that variable in the logging task.

    Thank You

  • I have implemented something very similar to this however; instead of creating the PackageLogID as a user variable I am just using the system variable "ExecutionInstanceGUID". I am curious though, did you choose to create a user variable for a particular reason? One reason I could see is so that you could deal with an int value insead of a GUID but did you have other reasoning?

    Regards,

    Jason

    Regards,

    Jason P. Burnett
    Senior DBA

  • Obviously, there is a reason for using PackageLogID as a user defined variable for tracking the execution of the package. Below is the list:

    •It’s datatype is Int, so easy for calculation and analysis.

    •Its size is less (datatype size), obviously good then using GUID.

    •Can be sorted easily and is meaningful for the user (for easy understanding and detecting than GUID)

    Thanks for your comment.

  • Thanks for the details. Greatly appreciated!

    Regards,

    Jason P. Burnett
    Senior DBA

  • I have been using SSIS for a while, but haven't tapped into the power of even handling yet. This is a great and useful introduction!

Viewing 15 posts - 1 through 15 (of 20 total)

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