@Date is the start date from when you want the week data and @NumberOfWeeks is the number of subsequent weeks for which you want the data. Please modify these values as required.
--Create the temp table to hold the data
IF OBJECT_ID('TempDB..#Dates') IS NOT NULL
DROP TABLE #Dates;
CREATE TABLE #Dates
( [Year] INT NOT NULL,
[WeekNumber] INT NOT NULL,
[RequiredWeek] NVARCHAR(255) NOT NULL,
[Date] DATETIME NOT NULL
);
--DECLARE @Date Datetime='2016-1-1'; --for testing
--DECLARE @Date Datetime='2016-12-31'; --for testing
DECLARE @Date Datetime='2015-12-31';
DECLARE @Days INT;
DECLARE @NumberOfWeeks INT;
DECLARE @Ctr INT=0;
SET @NumberOfWeeks=9
WHILE @Ctr<@NumberOfWeeks
BEGIN
SET @Days=@Ctr*7
INSERT INTO #Dates
SELECT DATEPART(YEAR,@Date+@Days) AS [Year],
DATEPART(wk,@Date+@Days) AS [WeekNumber],
CAST(DATEPART(YEAR,@Date+@Days) AS VARCHAR(10))+'W'+ CAST(DATEPART(wk,@Date+@Days) AS VARCHAR(10)) AS [RequiredWeek],
@Date+@Days AS [Date]
SET @Ctr=@Ctr+1
END
SELECT * FROM #Dates;
OUTPUT:
Year WeekNumber RequiredWeek Date
2015 53 2015W53 2015-12-31 00:00:00.000
2016 2 2016W2 2016-01-07 00:00:00.000
2016 3 2016W3 2016-01-14 00:00:00.000
2016 4 2016W4 2016-01-21 00:00:00.000
2016 5 2016W5 2016-01-28 00:00:00.000
2016 6 2016W6 2016-02-04 00:00:00.000
2016 7 2016W7 2016-02-11 00:00:00.000
2016 8 2016W8 2016-02-18 00:00:00.000
2016 9 2016W9 2016-02-25 00:00:00.000