Complex foreign key

  • Comments posted to this topic are about the item Complex foreign key

  • Took me a while to work this out, as I thought the lower-case l for the first column was a number 1. Would have been better with different column names!

    After this it was clear that master would be created, so it was just a question of working out the only combination of 3 other options that weren't mutually contradictory.

  • When I posted the qotd, all names were lower case. I don't know who capitalized them.

    My instance of sqlserver has the binary collation.

  • I suppose giving the full message rather than "etc" would have given it away.

  • An interesting QotD, but it was necessary to proceed slowly and cautiously to find the right answers...:hehe:

    Thanks Carlo for thoughtfully prepared question and good references.

  • I got the responses correct except that I also included "Command(s) completed successfully." -- which does flash briefly due to the master table creating successfully (doing them individually shows that as well).

    Oh well....

  • Aaron N. Cutshall (9/22/2016)


    I got the responses correct except that I also included "Command(s) completed successfully." -- which does flash briefly due to the master table creating successfully (doing them individually shows that as well).

    Oh well....

    The batch is only one! "Command(s) completed successfully." appears only if the entire batch runs without errors.

  • Good interesting question.

    I rather dislike SQL Server's lumping together of multiple cascade paths and cascade cycles; it shouldn't be forcing us to use triggers in all cases where there can be multiple cascade paths. I'm perfectly happy for it to refuse to handle cascade cycles because I think a that it's potentially possible to obtain different results according to what order updates and/or deletions take place, but I would prefer to see it hadling multiple cycle-free cascade in cases where it's easy to detect (from the metadata) that different resuts can't be produced by different operation orders (as in the example in this case).

    Tom

  • Carlo Romagnano (9/22/2016)


    Aaron N. Cutshall (9/22/2016)


    I got the responses correct except that I also included "Command(s) completed successfully." -- which does flash briefly due to the master table creating successfully (doing them individually shows that as well).

    Oh well....

    The batch is only one! "Command(s) completed successfully." appears only if the entire batch runs without errors.

    Good point. Since batch is what was mentioned in the QotD, that's what I should rely on. And, upon further reflection, I think the message I saw flash was simply that the table was created.

  • Really interesting question. Thanks, Carlo!

  • Aaron N. Cutshall,

    I agree with you.

    I have not received the incorrect syntax message, anyway I gocheck syntax with button parse and received the message Command(s) completed successfully.

    😀

  • Carlo Romagnano (9/22/2016)


    When I posted the qotd, all names were lower case. I don't know who capitalized them.

    My instance of sqlserver has the binary collation.

    We reformat code to highlight keywords.

  • I knew the answer but for the life of me I couldn't figure out why I needed to choose 4 answers. For some reason my brain did not understand that all the answers were about logical problems but one was about syntax. Good question but the one answer really threw me off.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • This was removed by the editor as SPAM

  • Good question, but a small nit-pick:

    "The syntax of the batch is correct" is not really an output of the batch, but the conclusion of the parser. That message doesn't appear anywhere.


    Just because you're right doesn't mean everybody else is wrong.

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply