• Yes, I have gone thru' that. That's what I meant cold archiving (predefined values). I have tried to do something like this:

    SET @SQLString = N'ALTER PARTITION SCHEME [' + @archiveScheme + '] NEXT USED [FileGroup_MDPTSP]'

    ...

    SET @SQLString = N'ALTER PARTITION FUNCTION ' + @archiveFunction + '()

    SPLIT RANGE ('''

    SET @strTEMP = CONVERT(NCHAR(8), DATEADD(day, 7, @dtStart), 112) -- +7 next partition

    SET @SQLString = @SQLString + @strTEMP + ''')'

    ..

    SET @SQLString = N'ALTER TABLE ' + @factTable + ' Switch Partition 1

    TO ' + @archiveTable + ' Partition 2 '

    ...

    SET @SQLString = N'ALTER PARTITION FUNCTION ' + @factFunction + '()

    SPLIT RANGE ('''

    SET @strTEMP = CONVERT(NCHAR(8), DATEADD(day, (7 + 1) , @dtEnd), 112) -- +1 bcoz of this is executre 2nd last day

    SET @SQLString = @SQLString + @strTEMP + ''')'

    in order let it work dynamically. Is that way right?