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

解决方案 »

  1.   


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

  2.   

    select Object_name(parent_obj) 表名,Name 外键名
    From sysObjects a
    where xtype='f'
      

  3.   

    select * from sysobjects where xtype='PK'
      

  4.   


    我说的是外键,应该是  where xtype='f'