Re: how to retrieve primary and foreign key
Posted in 1995
You need to join SYSCONSTRAINTS to SYSINDEXES and then SYSINDEXES to SYSCOLUMNS. The only problem is that SYSINDEXES table is not normalised and all the columns in the index are listed accross the row. You will need to join on each of these columns to SYSCOLUMNS. --------------------------------------------------------------------------------------------------------------------------------------- Rafal Czerniawski Dataspace Consulting Pty Ltd rafal@dataspace.com.au liuhuiti@iscs.nus.sg (Liu Hui Ting) wrote: >Hi, >I am trying to retrieve the primary or foreign keys from >SYSCOLUMNS, SYSCONSTRAINTS etc, but i did not find any >connection between those two tables. >can somebody give me any suggestion or hints to do that? >regards >liuhuiti@iscs.nus.sg