Solved

SQL 2012 Partitioning - Adding additional Partitions

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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…

777 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