P
Peter
Hi, we're using STored Procedures with MS-SQL and VS.net.
When the SP code attempts to insert a record and there is
a primary key violation, the check for for @@error inside
the SP would catch it. In our case, this is a business
issue, the SP would subsequently do some other processing
and finally do a custom RAISERROR or even nothing.
Unfortunately, the attempted INSERT statement does cause a
ms-sql error which leads to a SQLException on the client
side, which the client code has to deal with even though
the SP either does a custom RAISERROR later or completes
fine.
Is there a way to suppress the SQLException for the INSERT
error (either on the client or ms-sql side).
Unfortunately, the SQLException is generated while the
rest of the SP is still processing and the client code
gets confused. Any bit of sample code specific to this
issue would be very much appreciated.
When the SP code attempts to insert a record and there is
a primary key violation, the check for for @@error inside
the SP would catch it. In our case, this is a business
issue, the SP would subsequently do some other processing
and finally do a custom RAISERROR or even nothing.
Unfortunately, the attempted INSERT statement does cause a
ms-sql error which leads to a SQLException on the client
side, which the client code has to deal with even though
the SP either does a custom RAISERROR later or completes
fine.
Is there a way to suppress the SQLException for the INSERT
error (either on the client or ms-sql side).
Unfortunately, the SQLException is generated while the
rest of the SP is still processing and the client code
gets confused. Any bit of sample code specific to this
issue would be very much appreciated.