Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Partioning Composite Key

Author  Topic 

apcoffey
Starting Member

1 Post

Posted - 2011-01-13 : 00:57:30
Hi,

I have an oracle background and have been placed into a SQL Server role. I have been working with SQL Server for a little over a month.

Recently we've had the issue where we really needed to split up the partition to increase performance (everything in one huge partition). My problem is that some of these tables have composite primary keys. So the question is how do you do this.

The following clearly don't work:

CREATE PARTITION FUNCTION cicm_dnc_file_detail_pf (INT,INT)
AS RANGE LEFT FOR VALUES (1,1)


CREATE PARTITION FUNCTION cicm_dnc_file_detail_pf (INT,INT)
AS RANGE LEFT FOR VALUES (1),(1)


It states:

Msg 7703, Level 16, State 1, Line 49
Can not create RANGE partition function with multiple parameter types.

Which makes me think that I have to use something else other than RANGE LEFT, maybe I need to create a partition function for each key or perhaps I'm just way off.

I'd just like to say that I have gotten the partioning to work for tables with a single primary key without problems, so I do understand partitioning. I'm just a little stuck on this. I can't find any examples on google.

Thanks for any help you can give me.
Adam

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-13 : 07:04:44
Partition on one column, but create a clustered primary key index which includes the partitioning column and the other column..and you will get the same effect.

I believe this article will be useful reading.http://www.simple-talk.com/sql/database-administration/partitioned-tables-in-sql-server-2005/



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page
   

- Advertisement -