Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you handle message of failure?
Message
From
29/03/2010 17:36:42
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01457950
Message ID:
01457973
Views:
46
>I do want constraint but I want the message to the user to be simple and practical. So I guess what I am getting from this discussion is that I will need to "translate" the technical message from SQL Server into a more user-friendly one. I think I will use the name of the constraint as a key for "translation."
>
>>You cannot have it both ways. Either you have constrains or you don't.
>>
>>>My UI allows user to enter the data; so there is a potential for them to enter wrong value; nothing I can about it. If I give them only combo boxes for selecting from pull-down lists some won't be happy. Thank you for your input.
>>>
>>>>Make sure that your front end does not allow such situations. After that you can treat such errors as exemptions and log them as other errors.

You could validate the FK from the UI before you commit the record(s). Since the FK will probably be part of an index on the parent a select to confirm the FK existence should be very quick, and easy to handle (if your qurey returns nothing, the value they entered is incorrect).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform