I have a table that consists of, among other things, two fields named StartTime and EndTime. Both are TIME fields.
I want to add a constraint preventing the insertion of any records that overlap with preexisting time ranges. E.g. if a record already exists with StartTime = 5:00, EndTime = 10:00, I would want an insert with StartTime = 6:00, EndTime = 9:00 to fail due to the overlap.
Is there any way to accomplish this, with or without triggers?