Solved

SQL 2012 Partitioning - Adding additional Partitions

Posted on 2016-09-23
3
62 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

809 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