Delete data with foreign key in SQL Server table

后端 未结 9 629
青春惊慌失措
青春惊慌失措 2020-12-12 20:32

I\'m going to delete data in an SQL Server table (parent) which has a relationship with another table (child).
I tried the basic Delete query. But it isn\'t working (and

9条回答
  •  生来不讨喜
    2020-12-12 21:08

    So, you need to DELETE related rows from conflicted tables or more logical to UPDATE their FOREIGN KEY column to reference other PRIMARY KEY's from the parent table.

    Also, you may want to read this article Don’t Delete – Just Don’t

提交回复
热议问题