SQL Server 清除表TRUNCATE TABLE 提示: 因为该表正由 FOREIGN KEY 约束引用
https://blog.csdn.net/dengguawei0519/article/details/101315699
1。找到引用这个表外键名称
SELECT * FROM sys.foreign_keys
WHERE referenced_object_id=OBJECT_ID('User');
删除外键 删除掉引用表的外键
ALTER TABLE dbo.XX DROP constraint FK_User_XX