Page 1 of 1

Dear database designer

Posted: Tue Aug 13, 2013 2:13 pm
by dandymcgee
This is not how you assign a primary key:

Image

Re: Dear database designer

Posted: Tue Aug 13, 2013 5:25 pm
by Nokurn
Mother of god. That's just asking for trouble. DId you fix it?

Re: Dear database designer

Posted: Wed Aug 14, 2013 8:05 am
by dandymcgee
Nokurn wrote:Mother of god. That's just asking for trouble. DId you fix it?
I can't right now because my boss is on vacation and I don't know the details of what, if anything, accesses this table. It may just be a history table for our reference, as I don't know of any application that allows rolling back records. If that is the case, I'll remove all of the '_%TicketNumber%' suffixes from the pkBackupDate column and set (pkBackupDate, TicketNumber) to the primary key like it should be. There's a reason primary keys can span multiple columns and it's to prevent the need for this sort of silly "hashing" approach to creating a unique key.