Pulling Primary/Foreign Key Relationships

Database
Enthusiast

Pulling Primary/Foreign Key Relationships

Hello All,

I am currently working on pulling down metadata from a given Teradata database and have run into a problem. I have figured out how to pull all the tables/columns/views/stored procedures of a given database, but now I need to pull all the primary/foriegn key relationships down. All I need is the proper select to do such a thing.

Something to keep in mind, I only have read access to the databases I am working with. If no relationships exist, that is fine, but I need to pull any and all that do.

Thanks,

Sean

1 REPLY
Enthusiast

Re: Pulling Primary/Foreign Key Relationships

I hope any of these tables below can help you.

DBC.All_RI_Children

DBC.All_RI_Parents

DBC.RI_Distinct_Children

DBC.RI_Distinct_Parents

You can analyze these table and see what you want to pull.

Cheers,

Raja