I'll leave it to Kevin E. Ford to describe today's WTF:

So there I was (no sh!t) innocently evaluating an off-brand accounting package.  One of the things I wanted to look at was the table structure.  Right off the bat I noticed that there was no referential integrity constraints, strange but I can live with it. 

I then go to open the Companies table.  I find that the following three fields make up the primary key:

CompanyId     nVarChar     36  Disallow Nulls
DivisionId    nVarChar     36  Disallow Nulls
DepartmentId  nVarChar     36  Disallow Nulls

Ok, maybe I misunderstood the relationship between the Companies table, the Departments table and the Divisions table.  Fair enough, I then opened up the Departments table to find the following fields comprising the primary key:

CompanyId     nVarChar     36  Disallow Nulls
DivisionId    nVarChar     36  Disallow Nulls
DepartmentId  nVarChar     36  Disallow Nulls

Then the Divisions table:

CompanyId     nVarChar     36  Disallow Nulls
DivisionId    nVarChar     36  Disallow Nulls
DepartmentId  nVarChar     36  Disallow Nulls

I think I now understand why there were no referential integrity constraints, can you say deadlock?  Also since all three tables really have the same keys, they are all on the same logical level.  You might as well just have put all the fields in the same table with a single ID.  Needless to say this was the last straw for my evaluation.
 

 

 

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!