• Cannot see any reason for scanning the table to produce the week numbers when it can be done more efficiently without it.
    😎

    Here is a far better method with only two constant scans and no sort operator.


    USE TEEST;
    GO
    SET NOCOUNT ON;

    ;WITH T(N) AS (SELECT X.N FROM (VALUES (0),(0),(0),(0),(0),(0),(0),(0)) X(N))
    , NUMS(N) AS (SELECT TOP (52) ROW_NUMBER() OVER (ORDER BY @@VERSION) AS N
         FROM T T1,T T2)
    SELECT
      NM.N AS WEEK_NUM
    FROM  NUMS  NM
    ORDER BY NM.N;