How to pass the error messages?

  • Hello,

    I'm executing a DTS package from C# and I'd like to know how you pass the specific error/exception messages in the DTS package to C# instead of just getting the generic "Task 19 failed". How do I do this?

    Thanks!

    Rafferty D. Uy

    Associate Software Engineer

    Navitaire International, LLC

    Tel. No.: 63-2-8304532

    Fax No.: 63-2-8304404

    E-mail: raff.uy@navitaire.com

    ___________________________________________________________________

    "If better is possible, then good is not enough." - John Maxwell

  • Hm.. no ones answering... does this mean that this can't be done?

  • You can do this but be prepared for some work.

    Easiest method is to hook into the event model of the package.  Mr. Gert Drapers has a site that details how to work with the eventhandlers the DTS exposes from C## on his site sqldev.net

    Enjoy!

    Trey Johnson | Chief Business Intelligence Architect | Cizer Software (www.cizer.com)

    Who? - Cizer - http://www.cizer.com/about.htm - Blog - http://www.sqlserverbi.com/
    What? - Products enhancing Microsoft Business Intelligence - http://www.cizer.com/products.htm
    Wow! - Empower your Developers.... NEW Drop In Reporting - http://www.cizer.com/cnr-drop-in-reporting.htm
    How? - BI Training - http://www.cizer.com/training.htm - Cizer Solutions - http://www.cizer.com/solutions.htm

  • Hi trey,

    I wasn't able to find the details on the event model package on the site, but I tried doing something that involves events as well. I'm not sure if this is the same as what you were talking about but this involved the use of a PackageEventsSkink object (I also tried searching the net for "C# DTS Event Model" and the same articles came out). But when I tried printing the error in its OnError method and this is what came out...

    In OnError : Event Source : DTSStep_DTSExecuteSQLTask_21

    Error Code : -2147220421

    Source : Microsoft Data Transformation Services (DTS) Package

    Description : The task reported failure on execution.

    HelpFile : sqldts80.hlp

    HelpContext : 1100

    InterfaceError {10020306-EB1C-11CF-AE6E-00AA004A34D5}

    when it should be a...

    Could not find stored procedure 'ins_something'.

    Well, this error is found in the DTS SQL Task 21 object... but I was hoping that the error returned in C# will be as specific as when we try to run it in SQL Server.

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

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