August 30, 2016 at 11:12 pm
Comments posted to this topic are about the item Where's the error?
August 30, 2016 at 11:12 pm
This was removed by the editor as SPAM
August 31, 2016 at 12:55 am
Bit too easy that one Steve, but good not to have to use the brain this early in the day.
Thanks
August 31, 2016 at 4:50 am
Dang, I did not think my first thought was correct so chose the wrong one. If I just would have went with my first...
August 31, 2016 at 5:29 am
Good Question, I took the obvious answer, but because it was QOD, I was expecting a "got ya".
August 31, 2016 at 5:31 am
It was different than recent questions and got my brain moving before caffeine. Thanks.
August 31, 2016 at 6:27 am
I failed to apply the fundamental rule: engage brain before finalizing choice - - I was so happy at spotting that WITH CHECK OPTION would guarantee failure if the update actually did update a row in the view that (a) I didn't notice that the column being updated wasn't actually in the view so it couldn't be updated through the view and (b) even if the column had been in the view, if CHECK OPTION were the only source of failure the where clause might ensure that CHECK OPTION had no rows to check so a CHECK OPTION error couldn't be the answer. :blush:
Tom
August 31, 2016 at 6:39 am
In our shop we only use views to retrieve data, not update it.
August 31, 2016 at 7:21 am
BillLudlow (8/31/2016)
Bit too easy that one Steve, but good not to have to use the brain this early in the day.Thanks
As of now, only 47% percent of respondents got the correct answer, so apparently it isn't "too easy".
(;
August 31, 2016 at 7:34 am
Kaye Cahs (8/31/2016)
BillLudlow (8/31/2016)
Bit too easy that one Steve, but good not to have to use the brain this early in the day.Thanks
As of now, only 47% percent of respondents got the correct answer, so apparently it isn't "too easy".
(;
Don't forget that people can get things wrong just because they are too easy - remember Poe's purloined letter. 😎
Edgar Allan Poe (1845)
"Perhaps it is the very simplicity of the thing which puts you at fault," said my friend."What nonsense you do talk!" replied the Prefect, laughing heartily.
"Perhaps the mystery is a little too plain," said Dupin.
"Oh, good heavens! who ever heard of such an idea?"
"A little too self-evident."
Tom
August 31, 2016 at 8:07 am
There were so many possible problems with the view and the update, that I concentrated in the wrong one.
August 31, 2016 at 6:00 pm
I didn't have it easy, but I learned something new, thanks Steve.
Qotd from 2016/08/31 was brilliant, because all the first three answers were right... 😉
The first error was, that the HireDate was not in the definition of the view NewEmployees.
If HireDate was added to the definition, an error occurred while converting date '20150230'.
After the repair to the '20150228' was finally the third error, which is interestingly specified:
"The attempted insert or update failed because the target view either specifies WITH CHECK OPTION
or spans a view that specifies WITH CHECK OPTION and one or more rows resulting from the operation
did not qualify under the CHECK OPTION constraint. The statement has been terminated."
A good explanation is at https://www.sqlservercentral.com/articles/Stairway+Series/107120/
September 4, 2016 at 7:14 pm
Grrrrr.... Good question. My snap judgment was wrong, and in hindsight it's easy to see why. One day I will learn to consider everything that's in the example before picking an answer. Happy to see Tom's comments, though. At least I feel I'm in good company.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
September 7, 2016 at 6:42 am
Easy one, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply