Solved

SQL 2012 Partitioning - Adding additional Partitions

Posted on 2016-09-23
3
41 Views
Last Modified: 2016-09-26
I created some years ago a Partitioned table and now need to add additional partitions.  The problem I'm having is the ALTER statement for the Partition SCHEMA and FUNCTION.

I have attached the original query that created the existing partitions, schema and functions (CreatePart.sql) along with the update query (UpdatePart.sql).

This is the part that is not working:

ALTER PARTITION SCHEME COMPL_DTE__PS
NEXT USED TMS20181001

ALTER PARTITION SCHEME COMPL_DTE__PS
NEXT USED TMS20191001

ALTER PARTITION SCHEME COMPL_DTE__PS
NEXT USED TMS20201001


ALTER PARTITION FUNCTION COMPL_DTE_PF ()
SPLIT RANGE ( '20181001' )

ALTER PARTITION FUNCTION COMPL_DTE_PF ()
SPLIT RANGE ( '20191001' )

ALTER PARTITION FUNCTION COMPL_DTE_PF ()
SPLIT RANGE ( '20201001' )


This should be a simple task, but the syntax is driving me nuts.

Thank you.
CreatePart.sql
UpdatePart.sql
0
Comment
Question by:wdbates
3 Comments
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
ID: 41813032
Maybe this?:

ALTER PARTITION SCHEME COMPL_DTE__PS
    NEXT USED TMS20181001;
ALTER PARTITION FUNCTION COMPL_DTE_PF ()
    SPLIT RANGE ( '20181001' );

ALTER PARTITION SCHEME COMPL_DTE__PS
    NEXT USED TMS20191001;
ALTER PARTITION FUNCTION COMPL_DTE_PF ()
    SPLIT RANGE ( '20191001' );

ALTER PARTITION SCHEME COMPL_DTE__PS
    NEXT USED TMS20201001;
ALTER PARTITION FUNCTION COMPL_DTE_PF ()
    SPLIT RANGE ( '20201001' );
0
 
LVL 11

Expert Comment

by:Máté Farkas
ID: 41814637
Why does it not work? What is the error message?
0
 

Author Closing Comment

by:wdbates
ID: 41816128
Thank you Scott your solution worked perfect.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now