Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you handle message of failure?
Message
 
 
To
30/03/2010 10:18:36
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01457950
Message ID:
01458071
Views:
41
>>>>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."
>>>
>>>It doesn't make any sense. Why would you allow from end to accept invalid data in the first place?
>>
>>This is the question. Should I call the SQL table to check if user made a valid entry (by querying the primary table UNIQUE field) or rely on the constraint to catch the invalid entry. In the VFP back end I am using the index and SEEK for the value before writing update. I thought that to minimize the trips to SQL Server to simply make the data go only one time and rely on the constraint. The point is that SQL Server will check for the constraint anyway, why not rely on it for data validation?
>
>Dmitry,
>I agree with what Naomi and other said about pre-checking for the value. If you try to parse a sql failure you have introduced two additional problems. One is performance as a SQL failure depending on your DA code will most likely be slower than your pre-testing. Second you have control over the outcome. What I mean by that is if you try to determine the failure based on a SQL server return message of some kind and the next version of SQL changes that slightly you will be without a paddle. If you just test for the value and if not exist give the user a message. That is better timing anyway as you can check it when appropriate before a save is tried.
>Just my .02
>Tim

Tim,
Your .02 are worth a dollar. You make a good point about SQL server message possibly changed with a new version. Makes a lot of sense. Thank you very much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform