SQL

  • CASCADE was added in SQL Server 2000.

    I remeber because in SQL Server 7.0, I wrote triggers to cascade update and delete on 100+ tables in a database, and 3 months later when we upgraded to 2000, casecade was available on foreign key constraints.

    Thomas LeBlanc, MVP Data Platform Consultant

  • One more time stupid question... Does anybody make review before its became published ? Also it would be nice to have possibility dismiss results for this one.

    MS SQL 2008 MCITP x 3
    MS SQL 2012 MCSE x 2

  • Well, I thought this was an easy question, until I read the comments.

  • Rather late in getting around to attempt to answer this particular QOD and

    Correct answers: .. 30% (164)

    Incorrect answers: 70% (376)

    Total attempts: 540

    [Rant]

    IMHO the discussion of CASCADE options has certainly increased the benefit of the QOD for those who have read the discussion (comments), other than that, this particular QOD would be a GREAT example of what is NOT an acceptable submittal.

    [/Rant]

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Koen Verbeeck (11/30/2012)


    Got it wrong because you can update or delete rows in the primary tables if you specify ON CASCADE options.

    Next time do more homework please.

    I completely concur

    On CASCADE handles the first "correct answer". We can delete a row from the primary table if there is ON CASCADE settings in place to handle it.

    Can delete a row from primary table if there are related rows in secondary table,

    And if the Foreign Key column is Nullable, you can certainly insert rows that are not related to the primary table.

    Can insert a new row in secondary table if there are not related rows in primary table



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • dineshbabus (11/30/2012)


    I think he is expecting us to think in normal scenario.. We shud not think beyond that..

    My normal scenarios include Nullable foreign keys and DELETE CASCADE options.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Koen Verbeeck (11/30/2012)


    dineshbabus (11/30/2012)


    How come you are saying Cascade is normal on update/delete. By default it will be No Action rite?

    Yes. But changing it is also normal.

    Just because the default prevents something, doesn't mean it cannot be done at all.

    And columns when they are created unless NOT NULL is specified on a default install of SQL are nullable. So Nullable Foreign keys are the default 🙂



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Hugo Kornelis (11/30/2012)


    Tom, I also have been trying to find when cascading referential integrity was introduced. Like you, I could not find anything conclusive, but I might very well have been SQL 2000.

    I'm pretty sure I remember using it in SQL 7.0, which was my first version of SQL I used in production. Spent a good 6 years using it too until the ERP we were using got upgraded to a version that supported SQL 2000. 6 months before the release of SQL 2005.

    Guess I'm getting old enough to confuse 2000 with 7. Perhaps it was triggers I used to mimic it. In either case it's been almost 8 years since I've seen 7.0 so who am I to argue? 🙂



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Good question if only I had read the "not", oh well.

    Thanks,

    Lon

  • Thanks for the question.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Saramilla.. Author oru paavamanu.. leave it.. Avanu vendi njan maapu chodikunnu.

  • Jamsheer (12/4/2012)


    Saramilla.. Author oru paavamanu.. leave it.. Avanu vendi njan maapu chodikunnu.

    Isn't the very point of posting on a forum so that you can share your thoughts with others? No idea what language this is in, but I doubt most people on this forum know it.

    Hakim Ali
    www.sqlzen.com

  • hakim.ali (12/4/2012)


    Jamsheer (12/4/2012)


    Saramilla.. Author oru paavamanu.. leave it.. Avanu vendi njan maapu chodikunnu.

    Isn't the very point of posting on a forum so that you can share your thoughts with others? No idea what language this is in, but I doubt most people on this forum know it.

    I'm with you Akim.

  • I think I just got confused by the double negative aspect of the question -which statement is NOT true and the statement are full of Can and Cant - should have taken a bit longer to think them all through! 😀

  • Just went wrong due to the NULL value possibilty. 🙁

    Some projects have already failed with such a lack of precision ... :w00t:

Viewing 15 posts - 46 through 60 (of 60 total)

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