Home Forums SQL Server 2008 T-SQL (SS2K8) Weird behavior with a foreign key and "on delete set null" RE: Weird behavior with a foreign key and "on delete set null"

  • Ah good, gives another small bit of ammunition to maybe upgrade to 2012. 🙂

    The actual behavior isn't matching the ON SET NULL either, unfortunately. I looked a little more closely at the triggers, and both are running after insert/update/delete triggers that update Invoices.order_id if there are any changes to either table (The Invoices table just has update/insert, the delete is an instead of that sets the deleted bit).

    I think I'm going to talk to the original developer and see if I can disable/remove those triggers and just use the cascading options on the FK instead; it seems like that should be sufficient.