Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

ALTERING an already partitioned table ...

$
0
0

I am looking for the definitive step-by-step doc on how to go about "updating" <for lack of a better word> and out-of-date partition scheme.

The table is serveral billion rows so I want to make sure I have all my steps covered.

It looks like the partion was created in 2005 and ended the last day of 2008 so there is data in the primary partition containing data from 2009 through today.

I need to find out how to alter the partition schema to have the partition functional thru 2015 or better and then I need to know the steps to push out the 2009 thru the 2012 data to their respective file groups that I need to create.

Here is a "sample" of what my partition scheme and function look like:

CREATE

PARTITIONFUNCTION[MyDateRange](smalldatetime)ASRANGE RIGHTFORVALUES

(

N'1998-01-01T00:00:00.000',

N'2002-01-01T00:00:00.000',

 

N'2005-01-01T00:00:00.000',

N'2005-07-01T00:00:00.000',

N'2006-01-01T00:00:00.000',

N'2006-07-01T00:00:00.000',

N'2007-01-01T00:00:00.000',

N'2007-07-01T00:00:00.000',

N'2008-01-01T00:00:00.000',

N'2008-07-01T00:00:00.000',

N'2009-01-01T00:00:00.000')

)

 

CREATE PARTITIONSCHEME[My_Date] ASPARTITION[MyDateRange]TO (

([NDF_UpTo_2005],

[NDF_UpTo_2005],[NDF_UpTo_2005],

[NDF_2005],[NDF_2005],

[NDF_2006],[NDF_2006],

[NDF_2007],[NDF_2007],

[NDF_2008],[NDF_2008],

[PRIMARY]

)

Thanks,


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>