How to truncate a table with foreign Key in SQL Server.
當想要清空資料表時,我們可以用TRUNCATE語句來達到,但是當該資料表有使用外部索引鍵時,會出現如下錯誤:
無法截斷資料表'Table',因為該資料表正由FOREIGN KEY 條件約束參考 Cannot truncate table 'Table' because it is being referenced by a FOREIGN KEY constraint
文章標籤
全站熱搜
留言列表