Recently started working at a small company who's previous DB folk seem to have read the don'ts of DB development as the do's. Since we've all dealt with these situations, I was curious how all y'alls tackled this. For me, since PK/FK referential integrity was at best intermittently followed at the DB level, my thought is to find/document every JOIN statement in Views/SP's/Functions/Agent jobs to ID all of key combo's.
Before anyone starts shooting from the hip, I know this is not perfect/comprehensive or a good idea to just blindly implement - but it should give me a pretty solid idea of data relationships in the db.
I've read about automated scripts to create key relationships, but AFAIK those rely on field name and data types matching across tables and assume tables with the same key name/datatype would match on data, but in this DB they do not always match.