On Error () Logging by Using Event Handlers

  • mail.arun2005

    SSC Veteran

    Points: 247

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

  • Samuel Vella

    SSCrazy Eights

    Points: 8055

    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 🙂

  • loydjerry

    Valued Member

    Points: 64

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

  • mail.arun2005

    SSC Veteran

    Points: 247

    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

  • cwcridindirty

    Valued Member

    Points: 56

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

  • mail.arun2005

    SSC Veteran

    Points: 247

    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

  • cwcridindirty

    Valued Member

    Points: 56

    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!

  • Jeff Moden

    SSC Guru

    Points: 994663

    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.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. 😉

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

  • mail.arun2005

    SSC Veteran

    Points: 247

    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

  • Niraj Kotecha

    SSC Rookie

    Points: 30

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

  • mail.arun2005

    SSC Veteran

    Points: 247

    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

  • Jason P. Burnett

    SSCommitted

    Points: 1619

    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

  • mail.arun2005

    SSC Veteran

    Points: 247

    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.

  • Jason P. Burnett

    SSCommitted

    Points: 1619

    Thanks for the details. Greatly appreciated!

    Regards,

    Jason P. Burnett
    Senior DBA

  • Misha_SQL

    SSCertifiable

    Points: 5385

    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 19 total)

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