select so.name as table_name, sofkc.name as fk_constraint, sr.constid, sofkc.id, so2.name as referencing_table_name, so3.name as refered_table_name from sysobjects so, sysobjects sofkc, sysreferences sr, sysobjects so2, sysobjects so3 where so.name = 'shopper' and so.type = 'U' and sofkc.type = 'F' and sr.constid = sofkc.id and sr.fkeyid = so2.id and sr.rkeyid = so3.id order by table_name, fk_constraintI have included a table name in the where clause (so.name = 'shopper') to make it easier to determine if I'm getting what I want. However, once I have it working, I would like to get all the tables.