RE: Database with out PK or FK

RE: Database with out PK or FK

 

  

There are several different reasons why this may be the case, depending
on how the system evolved.

1) If this is an evolution of an older system, the system may have used
a record manager-type DB originally, or one without the concept of
Primary Key or Foreign Key. In this case, it may still use the same
logic required for keeping that data consistent.

2) If this is a system with obscure table naming (e.g. E0447AQ1), the
lack of PK can be used to obscure relationships deliberately, so the end
users will have limited ability to get at the information without
assistance (read: billable hours) from the vendor. (This can also
indicate #1 above)

3) At least once, I have come across a development effort that
deliberately did not use relationships. Why? They were making critical
software, and felt that if they couldn't code it correctly, then
depending on database features won't help in the long run.

Suggestion:

Look for Unique keys, which will frequently be the effective PK of the
table. Look for similar names between fields in other tables and Unique
keys. This can help drawing your relationship tree.


==+==+==+==+==+==+==+==+==+==+==
Brendt W. Hess
Database Administrator, Motosport, Inc
brendt.[Email address protected]
==+==+==+==+==+==+==+==+==+==+==

-----Original Message-----
From: Inmon Mark
[mailto:mssqldba-ezmlmshield-x37419950.[Email address protected]
Sent: Friday, September 28, 2007 8:33 AM
To: LazyDBA Discussion
Subject: Database with out PK or FK

Guys what would you do if you have a large database without Primary keys
or foreign keys.

I have been asked to produce reports on this system but really do not
know where to start. Never seen anything like this database or how they
maintain data integrity. I called the company and talked to a SR person
and they could not answer the question. How to you maintain data
integrity in a database with out keys.

806 tables
798 have no PK
806 have no relationships
Liberty Hospital Confidentiality Notice: The information contained in
this e-mail transmission is confidential information, proprietary to the
sender and legally protected. Its purpose is intended for the sole use
of the individual(s) or entity named in the message header. If you are
not the intended recipient, you are hereby notified that any
dissemination, copying or taking any action in reliance on the contents
of this information is strictly prohibited. If you received this message
in error, please notify the sender of the error and delete this message
and any attachments.


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


MS Sql Server LazyDBA home page