• prem.m38 - Sunday, December 10, 2017 2:35 AM

    Hi

    My tables are partitioned on business date. My requirement is to add 365 partitions for next year to existing partition function and scheme.

    1)ALTER PARTITION SCHEME[PS_D_FG1]

    NEXT USED FP_COM_FG1

    2) ALTER PARTITION FUNCTION [PF_DAILY_FG1]()

    SPLIT RANGE (N'2018-01-01T00:00:00.000') -- New Range

    GO


    I can able to add only one partition  at a time using above script. Could you please provide me script to add 365 partitions at a time for next year 2018.

    Will you have a separate file group for each day?  If so, what is the specific naming convention you want to use for the 365 days?  If not, do you want all of the partitions to be assigned to the FP_COM_FG1 file group?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)