1 --查询外键约束名 2 --SELECT name 3 -- FROM sys.foreign_key_columns f 4 -- JOIN sys.objects o 5 -- ON f.constraint_object_id = o.object_id 6 -- WHERE f.parent_object_id = OBJECT_ID('表名');
1 --查询外键约束名 2 --SELECT name 3 -- FROM sys.foreign_key_columns f 4 -- JOIN sys.objects o 5 -- ON f.constraint_object_id = o.object_id 6 -- WHERE f.parent_object_id = OBJECT_ID('表名');