>I have a table with transactional records, and each record has a start and an end date. I am creating a SPROC to insert a record into this table, but I want to make sure that the start date and end date in the record I am inserting does not overlap any of the date ranges in any records in the table.
IF NOT EXISTS (SELECT * FROM mytable
WHERE @StartDate BETWEEN StartDate AND EndDate
OR @EndDate BETWEEN StartDate AND EndDate)
INSERT INTO ...
--sb--