As you know SQL Server 2008+ gives us the courtesy of knowing what values are duplicate by saying
The duplicate key value is (foo, bar)
in the SqlException
message. Normally I get these values by using a regex and getting the data between the parentheses' to show it to end user.
I'm wondering; is there a more elegant way to get those values?
Don't think there is an elegant way, I would handle it the way you do with RegEx.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With