Need help on failed queries logging.

  • There was bug in the application where a “null” is being passed as one of the argument to a stored procedure call which is written to insert data in a table. In the table design the column is set with false value for allow nulls property. Because of this reason SQL server comes back with an error saying cannot update the null to non-nullable columns.

    The user of the application ignored the error and continued to use the application and they did not report it to us. Now they realized what mistake they did and looking for a help on the data they lost.

    I was wondering if the failed SP call is stored in any of the log files. I read in some blog that transaction file stores everything...does this mean it stored the failed insert statements too?

    I tried to use APEX SQL tool but that only shows the successful transaction statements.

    Can anyone of you please provide me some expert advice on this?

  • You should have some form of error handling (and logging) in either the procedure or in the front end app.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • We were displaying error message in such cases. But user ignored the error and continued using the application ..sounds very odd but true..I'm looking to get those call to stored procedure which will have all needed values. Then I will manually insert in the table.

  • SpyCraft (7/2/2009)


    We were displaying error message in such cases. But user ignored the error and continued using the application ..sounds very odd but true..I'm looking to get those call to stored procedure which will have all needed values. Then I will manually insert in the table.

    That's why we call them ABusers. You find them everywhere! 😉

  • SpyCraft (7/2/2009)


    We were displaying error message in such cases. But user ignored the error and continued using the application ..sounds very odd but true..

    Hardly unusual. Especially if the error was the default SQL error. User's not going to know what that means or what to do about it.

    I'm looking to get those call to stored procedure which will have all needed values. Then I will manually insert in the table.

    You need to handle and log the error when it happens, either in the procedure or in the front end. You can't expect the user to tell you when errors happen, or to remember the full text of the message if they do tell you about it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 5 posts - 1 through 5 (of 5 total)

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