Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2006
    Posts
    1

    Red face Unanswered: DTSLookup error handling

    Hello all,
    Does any one know how I can capture the sql error message when the sql statement in DTSLookup step fails?
    e.g.
    I have this sql statement in a DTSLookup task:
    insert into table1 (col1) values (?); select @@ERROR

    Let's say for some reason (bad data), my insert statement fails and I want to know why. So I added "select @@ERROR" to capture the error. However, from the Lookup window, I cannot save the result of @@ERROR to a global variable or to an output parameter. I want to log this error in the next step that handles the OnFailure workflow, but I don't know how.

    Can someone help please?

    Thanks,
    K.

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by DTS learner
    Hello all,

    Can someone help please?

    Thanks,
    K.
    Check out this link.

    From what I recall, you cannot handle DTS errors in VB Script, which is maddening to me. We sorta got around this by creating a VB DLL and then instantiated the VB DLL from within a calling DTS package. I've never been really happy with the solution, but I'm just the production DBA and not the "real" DBA .

    Regards,

    hmscott
    Have you hugged your backup today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •