Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you handle message of failure?
Message
De
29/03/2010 17:36:42
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01457950
Message ID:
01457973
Vues:
47
>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).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform