0

short question regarding partitions, consider the following partition definition:

CREATE PARTITION SCHEME [MSAppServerPS_ASWcfEventsTable] AS 
PARTITION [MSAppServerPF_ASWcfEventsTable] TO ([PRIMARY], [PRIMARY])
GO

From reading about this here I understand, that this will create the partition on the socalled primary filegroup. Unfortunately in the examples on that page I did not see one example that used the same filegroup name twice.

Can someone explain to me what that means?

1 Answer 1

1

A partition scheme works with a partition function.

you start by creating the function where you will define the range. then the partition scheme will tell you where to store the data according to that range.

Or, to say it in another way, that particular partition scheme is just stating that for values that fall under the first condition store it in the PRIMARY filegroup, and for values that fall into the the second condition use the PRIMARY FILEGROUP.

you'll sometime see it in examples as CREATE PARTITION ... ALL TO ([PRIMARY])

Hope this helps

2
  • so you mean TO ([PRIMARY], [PRIMARY]) would be equivalent to ALL TO ([PRIMARY]) what about just writing TO ([PRIMARY]) would that also mean the same thing? Sep 13, 2013 at 11:33
  • if all partiotions point to the same filegroup, then use "ALL TO ([FILEGROUPNAME])" where you'd replace filegroup name with the name of your filegroup. The alternative to that is to specify all the filegroups that the schema and function will use, rule of thumb, if you have a function with say 5 ranges, then you'll need to write 5+1 filegroup mappings
    – indio
    Sep 14, 2013 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.