I get the following error.
Could not drop object 'tablename' because it is referenced by a FOREIGN KEY constraint.
This means there are references for the table I want to truncate. Then I use to remove all constraint for all table using following queries.
use mydb
EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
truncate table mytable.
But it's not working, please assist.