Disabling foreign key constraint, still can't truncate table? (SQL Server 2005)

前端 未结 4 1110
逝去的感伤
逝去的感伤 2020-12-09 08:08

I have a table called PX_Child that has a foreign key on PX_Parent. I\'d like to temporarily disable this FK constraint so that I can truncate PX_Parent. I\'m not sure how

4条回答
  •  庸人自扰
    2020-12-09 08:53

    You can't truncate the table if there is any foreign key referencing it, including disabled constraints. You either need to drop the foreign key constraints or use the DELETE command.

提交回复
热议问题