I have a table that holds all the days/months of the year
E.G.
Day Month
1 9
2 9
3 9
4 9
5 9
6 9
You can use CTE and write a query as:
declare @StartDate DATE, @EndDate DATE
set @StartDate = '2013-09-01';
set @EndDate = '2013-09-30';
WITH DateRange(Date) AS
(
SELECT
@StartDate Date
UNION ALL
SELECT
DATEADD(day, 1, Date) Date
FROM
DateRange
WHERE
Date < @EndDate
)
SELECT 'webshop',Date
FROM DateRange
EXCEPT
SELECT DataSet,DateRange
FROM ImportedDateRange
WHERE DataSet='webshop'
--You could remove Maximum Recursion level constraint by specifying a MaxRecusion of zero
OPTION (MaxRecursion 10000);