My team is trying to run a script that is in source control to create partitions and we’re running into the following error: CREATE/ALTER partition function failed as only a maximum of 1000 partitions can be created.
Part of script:
CREATE PARTITION FUNCTION [PFDailyPartition](DATETIME)
AS RANGE RIGHT FOR VALUES ('01/01/2005 00:00:00'
'01/02/2005 00:00:00'
'01/03/2005 00:00:00'
'01/04/2005 00:00:00'
'01/05/2005 00:00:00'
'01/06/2005 00:00:00'
'01/07/2005 00:00:00'
'01/08/2005 00:00:00'
'01/09/2005 00:00:00'
'01/10/2005 00:00:00'
'01/11/2005 00:00:00'
'01/12/2005 00:00:00'
'01/13/2005 00:00:00'
'01/14/2005 00:00:00'
etc...
Running select * from sys.partition_range_values on our current setup shows that we have over 10,000 partitions.
Is there any way to get around this 1000 limit? We can’t figure out how we have this many partitions already.
Could it be an environmental difference between the two setups?
Thanks in advance!
Your partition function is creating separate partitions by day. That’s a lot of partitions! Since 2005, this would be roughly 365 * 7 = 2,555 partitions. Do you realy want separate partitions by day?
According to this article, SQL Server 2008 SP2 and SQL Server 2008 R2 SP1 increased the limit to 15,000 partitions. Is there a service pack difference between the servers?
Quoted from the article: