C
Can Balioglu
I have a user table which has two columns with unique constraints (email and
username). I have a stored procedure which inserts a new user into my table.
When a constraint violation during the sp execution occurs, I'm trying to
programmaticaly determine which of the constraints caused the violation.
But here comes the problem. Both of the contraints generate exactly the same
error except the message string. Both errors have the number 2627, state 2
and linenumber 22. How can I determine which of the constraints caused the
violation?
PS: I'm programming in Ado.Net. During exception handling I need to
determine the cause of the error from the SqlException instance, but as I
said they both generate exactly the same error except the message string
which is not reliable.
Thanks for replies.
username). I have a stored procedure which inserts a new user into my table.
When a constraint violation during the sp execution occurs, I'm trying to
programmaticaly determine which of the constraints caused the violation.
But here comes the problem. Both of the contraints generate exactly the same
error except the message string. Both errors have the number 2627, state 2
and linenumber 22. How can I determine which of the constraints caused the
violation?
PS: I'm programming in Ado.Net. During exception handling I need to
determine the cause of the error from the SqlException instance, but as I
said they both generate exactly the same error except the message string
which is not reliable.
Thanks for replies.