Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

duplicate entry in unique index

Hi experts,
I have an unique index on following fields
PatientID
Day
ScheduleFrom
Now users claim they need to make one patient as an exception since this is being used for multiple purposes, how is that possible?
0
bfuchs
Asked:
bfuchs
  • 2
  • 2
1 Solution
 
Scott PletcherSenior DBACommented:
You can't without adding something to the key.

You could add a tinyint column to the table and index -- which takes only one byte, and handles up to 256 total dups.  You can default it to 0, and when a dup is required for yet another "special case", you can set a different unique value for it or force the user to assign a unique value.
0
 
bfuchsAuthor Commented:
Hi,
Would that cause an overhead to the data entry process, meaning it would take longer in general to save records to the database, especially when creating mass scheduling records?
0
 
Scott PletcherSenior DBACommented:
Nah.  A single, numeric byte that defaults to 0 would have no noticeable affect on that process whatsoever.
0
 
bfuchsAuthor Commented:
Thanks that was a quickie!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now