Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Longmont, CO

    Unanswered: Checking for @@Error in DTS package (was "Error Trouble")

    Hi Guys,

    SQL Server 2000

    I've run out of ideas on what to do with a DTS process that has suddenly started giving an error when one company is processed on it.

    Here's the deal:

    DTS package launches a complex set of stored procedures (built entirely without error handling) as a step in importing data from various customers. I have isolated the error to one segment where I have to cursor through records that have been identified as having changes. Unfortunately, this cursor is updating about 15 system tables and uses modular stored procedures, about 12 of them, to do the job.

    Error: The classic Subquery returned more than one value.

    Oddity: If I run the code in Query Analyzer I never get an error, the code finishes without complaints. If I run the exact same code via the DTS package I always get the error. Note that the cursor appears to process every row assigned to it and then the sproc throws the error.

    What I've Tried:
    1) The obvious, reviewing the code for any unprotected subqueries. Haven't found it.
    2) Checking for @@Error = 1 at key points in the code to try to isolate where this is happening. Can't catch it.

    Note that this same process is used for several other company's data import process and they do not error even when running the DTS package. Therefore I'm assuming it is a data issue with the one company that errors that is causing the problem.

    Any suggestions on what to try next would be greatly appreciated!

    Last edited by Fly Girl; 02-06-05 at 18:07.

  2. #2
    Join Date
    Dec 2004
    York, PA
    You are assuming @@Error is going to be 1

    IF @@ERROR > 0 then
    Sorry to be terse
    some say it's a curse
    I know it's worse
    I'm just diverse

  3. #3
    Join Date
    Jun 2003
    Longmont, CO


    Actually I was checking for

    IF @@Error = 0 Not @@Error = 1

    Then having it write markers to another table. Seems that every time I checked @@Error = 0.

Posting Permissions

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