|
Home > Archive > MS SQL Server > May 2005 > Error Handling
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hi,
Assume that I have two insert statements (in SP) that both of them can
conflict with two different constraints(e.g. PK and CHECK).
I have added a customized error to sysmessages but SQL Server returns the
error immediately as any of insert statements conflicts.
How can I handle this error and return my own error message to client?
Thanks in advance,
Leila
| |
| John Bell 2005-05-29, 3:23 am |
| Hi
There is not enough information to give you a full answer as this will
depend on what you client program is written in, for example for ADO.NET
check out http://www.sommarskog.se/error-handling-I.html#ADO.Net
These are a good foundation in error handling:
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
Posting DDL and example data will also help if you have a specific problem
http://www.aspfaq.com/etiquett_e.asp?id=5006
John
"Leila" <leilas@hotpop.com> wrote in message
news:%23ayyVNCZFHA.3280@TK2MSFTNGP09.phx.gbl...
> Hi,
> Assume that I have two insert statements (in SP) that both of them can
> conflict with two different constraints(e.g. PK and CHECK).
> I have added a customized error to sysmessages but SQL Server returns the
> error immediately as any of insert statements conflicts.
> How can I handle this error and return my own error message to client?
> Thanks in advance,
> Leila
>
>
|
|
|
|
|