Sybase 查看与目标表有外键关联的表名称
目标表为:TestTable
select sysobjects.name FK_Name,a.*from (select constrid,sysreferences.tableid,a.name as tablename,sysreferences.reftabid,b.name as reftabnamefrom sysreferences LEFT OUTER join sysobjects a on sysreferences.tableid = a.id LEFT OUTER join sysobjects b on sysreferences.reftabid = b.id ) a,sysobjectswhere a.constrid = sysobjects.id and (tableid = object_id('TestTable') or reftabid=object_id('TestTable'))