Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    Belgium
    Posts
    4

    Unanswered: update error handling

    Hi,

    I have the following problem:
    We replicate data from our mainframe (DMS II) to our SQLServer (and Informix) using Databridge and stored procedures.
    We found that there was a problem with the Update stored procedure when it doesn an update of a row that doesn't exist. Instead of returning an error so that databridge can call the Insert stored procedure, it just says "0 rows updated".
    We do not have the problem to Informix.
    Do you have any idea how you can handle this?

    Thanks for your help,

    Jan

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Use the @@ROWCOUNT value to determine whether any rows were updated.

    I suppose you could execute:

    select 1/@@ROWCOUNT after your statement, which would return a Divide By Zero error, but you would be better off implementing program logic that acts upon the @@ROWCOUNT value.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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