I don't have a table of holidays handy, so I haven't tested this very much - but as nobody else has attempted an answer, here's how I'd start:
declare @tempDate datetime,
@StartDate datetime,
@WorkingDays int,
@NonWorkingDays int,
@TargetDate datetime
set @StartDate = '2010-10-26' --Change this to a paramter
set @WorkingDays = 9 --Change this to a parameter
set @NonWorkingDays = -1
/*Work out the answer ignoring holidays */
set @tempDate = dateadd(d,@WorkingDays,@StartDate)
while (dateadd(d,@WorkingDays + @NonWorkingDays, @StartDate) < @tempDate)
begin
/*Work out how many holidays are in the interval we've worked out*/
select @NonWorkingDays = count(HolidayDate)
from Holidays
where HolidayDate between @StartDate and @tempDate;
/*Extend the interval to include the holidays we've just found*/
set @tempDate = dateadd(d,@NonWorkingDays,@tempDate)
/*See if @NonWorkingDays has changed with the new @tempDate*/
select @NonWorkingDays = count(HolidayDate)
from Holidays
where HolidayDate between @StartDate and @tempDate;
end
set @TargetDate = dateadd(d,@WorkingDays + @NonWorkingDays, @StartDate)
print 'Target Date: ' + cast(@TargetDate as varchar(50))
Note this only works for Holidays at the moment - not weekends. You'd have to load all weekends into the holiday table (or join to a weekends table or use the DATENAME function) but the calculation should be the same.
Not sure how your Holiday table handles duplicate dates (eg. Boxing Day and St Stephen's Day both fall on 26th Dec) so you might need to take account of that.