Truncate Table when FK are disable - by Rafael Salas

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 251876 Comments
Status Closed Workarounds
Type Suggestion Repros 2
Opened 1/15/2007 9:06:18 AM
Access Restriction Public


Performing a Truncate table is sometimes necessary even when there are foreign key constraints that point to the table to-be-truncated. Disabling FKs should be enough to accomplish that.  Actually, this is something that can be done in other DB engines (Oracle). Having to Drop/Create constraints or use DELETE statements are work around that either involve more steps or create unnecessary overhead in the system.
Sign in to post a comment.
Posted by DWalker on 9/15/2016 at 5:41 PM
Microsoft says that the workaround is a "simple" workaround? No, it's not.
Posted by Paul White NZ on 5/11/2011 at 5:07 PM
Added a workaround that lets you use TRUNCATE without dropping and recreating the FK constraints.
Posted by Microsoft on 5/24/2007 at 3:34 PM

Thank you for your feedback. Though there is a simple workaround for your request, allowing TRUNCATE TABLE when the referencing foreign key constraint has been disabled would be much faster than using the DELETE statement. We will take your request into consideration for a future release of SQL Server.

Thanks once again!

-- SQL Server Team