1.选择正确的库,在 dbo.sysobjects 里可查到所有的表、外键等信息
例如select * from sysobjects where type = 'U' ; type='U'可过滤出用户表,type='F'可过滤出外键
2.列的具体信息可在dbo.syscolumns 里查询,外键可在 dbo.sysforeignkeys 里查询
要删除列的外键约束时,先去sysforeignkeys中找到该key的 name,然后
alter table table_name drop constraint constraint_name