Complex foreign key

  • Carlo Romagnano

    SSC-Insane

    Points: 21880

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

  • Toreador

    SSChampion

    Points: 11248

    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.

  • Carlo Romagnano

    SSC-Insane

    Points: 21880

    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.

  • gvoshol 73146

    Hall of Fame

    Points: 3145

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

  • George Vobr

    SSCrazy Eights

    Points: 9089

    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.

  • Aaron N. Cutshall

    SSCrazy Eights

    Points: 8758

    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....

  • Carlo Romagnano

    SSC-Insane

    Points: 21880

    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.

  • TomThomson

    SSC Guru

    Points: 104772

    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

  • Aaron N. Cutshall

    SSCrazy Eights

    Points: 8758

    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.

  • Revenant

    SSC-Forever

    Points: 42467

    Really interesting question. Thanks, Carlo!

  • Junior Galvão - MVP

    SSCertifiable

    Points: 6448

    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.

    😀

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 717443

    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.

  • Sean Lange

    SSC Guru

    Points: 286518

    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

  • Rune Bivrin

    SSCertifiable

    Points: 7697

    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 19 total)

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