Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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

share|improve this answer
    
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? –  DrCopyPaste Sep 13 '13 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 '13 at 8:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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