I get the following message even when the table that references it is empty: “Cannot truncate table ‘dbo.Link’ because it is being referenced by a FOREIGN KEY constraint” Doesn’t seem to make much sense why this is occurring. Any suggestions?
Share
In SQL Server a table referenced by a FK cannot currently be truncated even if all referencing tables are empty or the foreign keys are disabled.
You need to use
DELETE(may require much more logging) or drop the relationship(s) prior to usingTRUNCATEand recreate them afterwards or see the workarounds on this connect item for a way of achieving this usingALTER TABLE ... SWITCH