table truncate failed
I used a simple "Transfer SQL Server Objects Task" to transfer all data for certain tables from one database to another database. I set "Replace" for ExistingData. The task failed because when it tried to truncate a table which is being
referenced by a FOREIGN KEY constraint. Is there a work around? Thanks.
December 14th, 2010 5:51pm
No.
You can't truncate a table that has foreign keys referring to it. The only way to truncate such a table is to remove the foreign key relationships first, or truncate/delete the records in the related table.
Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
December 14th, 2010 6:35pm
Yes ,
There is a work around Because you are trying to Truncate the table which has some child tables....It is being referenced by FK constraint.But you can create the CASCADE KEY ON DELETE so that it will delete the Orphan records in the Child table and load
the objects again...
December 14th, 2010 6:36pm