Want to create a SQL Server query using a table created at runtime that just has month numbers and year numbers? I did, so here's how I did it:DECLARE @StartDate datetime = '9/1/12', @EndDate datetime = '8/1/13'CREATE TABLE #cal (TheYear int, TheMonth int)INSERT #calSELECT YEAR(dateadd(month, number, @StartDate)), MONTH(dateadd(month, number, @StartDate))FROM ......