in reply to Managing a on-call Schedule

One thought that comes to mind is to keep two tables. One would hold the schedules like you have above, the other would hold the times and who is scheduled for those times. Then when you added a new schedule, try and insert it into the second table (probably 1 record for your smallest segment of time), if you succeed then the rule is okay, otherwise force the user to retry. An alternative would be to build an insert trigger that does similar checking for you when you attempt to insert a record. The advantage of the first idea is that you can easily use your second table to generate a view that will show any gaps in the schedules as well as disallowing overlaps.


___________
Eric Hodges