finding missing constraints.
1 posts in topic
Flat View  Flat View

Posted By:   Ricardo_Garcia
Posted On:   Wednesday, May 4, 2005 12:58 PM

how can I find all tables and foreign keys on those tables that should reference to a parent table but do not?

Re: finding missing constraints.

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, May 5, 2005 01:18 PM

Are you saying, you want to find tables where an ordinary column's values are essentially "supposed to be" a reference to a foreign key column in another table, but the relationship is not designated/constrained as such?

We do have situations like that in development, where we just haven't finally stabilized everything yet, or where the values in the referenced key column might be changing and might be null for a while, etc.

But I don't think there is any way of automatically identifying these situations. You have to remember, to keep track of them by hand, so when you are ready to formalize the foreign key relationship, you know which columns in which tables are going to be involved...
About | Sitemap | Contact