I have one table named:
Delegates
This table has four fields:
ID(Auto increment, Primary) MemberNo, FromYr, ToYr
Before inserting check if there is a record with the same values:
if not exists (select * from Delegates d where d.FromYr = @FromYr and d.MemNo = @MemNo) INSERT INTO Delegates ([MemNo],[FromYr],[ToYr]) values(@MemNo, @FromYr,@ToYr)