• I agree on staying with tested solutions. However, I just wanted to leave an idea on how it can be done by using a starting date (I chose the first Sunday of this year). You wouldn't need the CTE, it's just there to simulate the different weeks.

    WITH

    E(n) AS(

    SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)

    ),

    E2(n) AS(

    SELECT a.n FROM E a, E b

    ),

    E4(n) AS(

    SELECT a.n FROM E2 a, E2 b

    ),

    cteTally(n) AS(

    SELECT TOP 52 ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) - 1 n

    FROM E4

    ),

    Weeks(GetSunday) AS(

    SELECT DATEADD( WK, n, '20160102')

    FROM cteTally

    )

    SELECT 'BACKUP DATABASE AdventureWorks2012 TO DISK = ''Z:\SQLServerBackups\'

    + CASE WHEN DATEDIFF( WK, '20160102', GetSunday) % 3 = 0 THEN 'AdvWorksData1'

    WHEN DATEDIFF( WK, '20160102', GetSunday) % 3 = 1 THEN 'AdvWorksData2'

    WHEN DATEDIFF( WK, '20160102', GetSunday) % 3 = 2 THEN 'AdvWorksData3'

    END

    + '.bak'' WITH FORMAT;',

    GetSunday

    FROM Weeks

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2