--Load 6 Years starting with 2004 going thru Dec 31, 2009

declare @currdate datetime
declare @i int

set @i = 0

set @currdate = '2004-01-01'

while @i < 2192
begin

	insert into DimDate
	select convert(varchar,@currdate,101), datepart(yyyy, @currdate),
		datepart(m, @currdate), datepart(d, @currdate), datename(month, @currdate),
		datename(dw,@currdate)

	set @currdate = @currdate + 1

set @i = @i + 1
end



