January 14, 2012 at 9:00 am
Hi All
I would like to add 2 more years 2013 and 2014 to my current partition setup.
I've already created files data2013 and data2014 in filegroups fgData2013 and fgData2014
how do i alter scheme and function?
Here is my create scheme and function scripts.
CREATE PARTITION SCHEME [psMonthYearByDate] AS PARTITION [pfMonthYearByDate] TO (
[fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010],
[fgData2010], [fgData2010], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011],
[fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012],
[fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012])
GO
CREATE PARTITION FUNCTION [pfMonthYearByDate](datetime) AS RANGE LEFT FOR VALUES (
N'2010-02-01T00:00:00.000', N'2010-03-01T00:00:00.000', N'2010-04-01T00:00:00.000', N'2010-05-01T00:00:00.000', N'2010-06-01T00:00:00.000',
N'2010-07-01T00:00:00.000', N'2010-08-01T00:00:00.000', N'2010-09-01T00:00:00.000', N'2010-10-01T00:00:00.000', N'2010-11-01T00:00:00.000',
N'2010-12-01T00:00:00.000', N'2011-01-01T00:00:00.000', N'2011-02-01T00:00:00.000', N'2011-03-01T00:00:00.000', N'2011-04-01T00:00:00.000',
N'2011-05-01T00:00:00.000', N'2011-06-01T00:00:00.000', N'2011-07-01T00:00:00.000', N'2011-08-01T00:00:00.000', N'2011-09-01T00:00:00.000',
N'2011-10-01T00:00:00.000', N'2011-11-01T00:00:00.000', N'2011-12-01T00:00:00.000', N'2012-01-01T00:00:00.000', N'2012-02-01T00:00:00.000',
N'2012-03-01T00:00:00.000', N'2012-04-01T00:00:00.000', N'2012-05-01T00:00:00.000', N'2012-06-01T00:00:00.000', N'2012-07-01T00:00:00.000',
N'2012-08-01T00:00:00.000', N'2012-09-01T00:00:00.000', N'2012-10-01T00:00:00.000', N'2012-11-01T00:00:00.000', N'2012-12-01T00:00:00.000',
N'2013-01-01T00:00:00.000')
GO
Thanks for all your help
January 14, 2012 at 11:25 am
Have you looked up ALTER PARTITION SCHEME and ALTER PARTITION FUNCTION in Books Online?
January 14, 2012 at 11:28 am
Here are the links to the topics Lynn suggested:
January 14, 2012 at 1:39 pm
i did and i tried
alter partition scheme psMonthYearByDate next used fgData2013
after adding one i scripted out partition scheme and got this:
CREATE PARTITION SCHEME [psMonthYearByDate] AS PARTITION [pfMonthYearByDate] TO (
[fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010], [fgData2010],
[fgData2010], [fgData2010], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2011],
[fgData2011], [fgData2011], [fgData2011], [fgData2011], [fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012],
[fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2012], [fgData2013], [fgData2012])
GO
so i panicked and decided to post
is there any way to get rid of [fgData2012] at the end and keep on adding [fgData2013]?
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy