Solved

SQL 2012 Partitioning - Adding additional Partitions

Posted on 2016-09-23
3
47 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:
Scott Pletcher 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 12

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

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

863 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

19 Experts available now in Live!

Get 1:1 Help Now