Stored Procedure and @@ERROR

  • Thread starter Thread starter Chris Woodcock
  • Start date Start date
C

Chris Woodcock

Hi,

I have written an update stored procedure which is called by an update
command in an SqlDataAdapter, when running the stored proc it is possible to
invalidate a foriegn key constraint. If I test the stored proc from query
analyser the @@ERROR contains 547 after the update when the contraint is
invalidated, which is correct, however if I call the stored proc from an
update on the SqlDataAdapter then the @@ERROR value is 0 after the contraint
violation which is no error and no rows are updated (because the contraint
really was invalidated) and this is mistaken for an optimistic lock
violation.

Anyone have clue?

Thanks,

Chris.
 
Back
Top