December 12, 2012 at 10:14 am
Hi All
It's coming close to the end of the year and I have a table that requires a new partition for 2013. My setup is similar to this except its ranges to the right. How do I add an extra range. ALTER PARTITION?
CREATE PARTITION FUNCTION FullOrderDateKeyRangePFN(DATETIME) AS
RANGE LEFT FOR VALUES
( '20011231 23:59:59.997',
'20021231 23:59:59.997',
'20031231 23:59:59.997',
'20041231 23:59:59.997' )
CREATE PARTITION SCHEME FullOrderDateRangePScheme AS
PARTITION FullOrderDateKeyRangePFN TO
([Filegroup_2001],
[Filegroup_2002],
[Filegroup_2003],
[Filegroup_2004],
[PRIMARY] )
December 12, 2012 at 10:20 am
See
http://www.simple-talk.com/sql/database-administration/partitioned-tables-in-sql-server-2005/
If you look down it has a section on adding and removing partitions - was written for v2005 but is still applicable.
Cursors never.
DTS - only when needed and never to control.
December 12, 2012 at 11:44 am
Nice one,
So 4 steps really. If I've got it right.
1 Create a new FG
2 Create a new data file.
3 Alter Scheme (NEXT USED = NEW FG)
4 ALTER FUNCTION split range (NEW DATE RANGE)
Is this correct?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply