• marlon.seton (3/21/2013)


    We use triggers to delete the child records when a parent record is deleted. Is that generally considered a bad thing to do?

    Bad? I would not say so (but others will disagree with me).

    But it's not smart either. If you have a business need for deleting child rows, why go to the lengths of building your own solution when the functionality you need is available out of the box?

    Okay, if you run into the issue with multiple cascading paths, you have no choice but to roll your own. And if you get a lot of deadlocks because of cascading updates, using triggers might alleviate that a bit. But other than than, why bother?


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/