Solved

SQL 2012 Partitioning - Adding additional Partitions

Posted on 2016-09-23
3
77 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

696 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