日期:2014-05-18  浏览次数:20362 次

SQL2000 查看 所有 外键
SQL2000 查看 所有 外键

我现在只知道进企业管理器,然后点右键---表--设计--管理关系。 但这样只能一个个看,有没有什么列表,就像表、存储过程,函数一样。

------解决方案--------------------
SQL code

--查看指定表
select * from sysobjects where parent_obj in(
select id from sysobjects where name='表名')
and xtype='PK'
--查看所有表
select * from sysobjects where xtype='PK'

------解决方案--------------------
select Object_name(parent_obj) 表名,Name 外键名
From sysObjects a
where xtype='f'
------解决方案--------------------
SQL code
select * from sysobjects where xtype='PK'