Reputation: 2882
To achieve partitioning, you can create a table on a partition scheme or create the table on primary followed by adding a clustered index on the partition scheme. Is there any difference/preference between the two approaches? They both seems to achieve the same set of partitions when querying system partitions.
Upvotes: 1
Views: 367
Reputation: 89331
Is there any difference/preference between the two approaches?
A Clustered Index is the table, so no, there is no difference. When you create a clustered index, either directly or through a Primary Key Constraint you are re-creating the table, and moving it to the partition scheme.
The only observable difference I can think of is if you start with a table on a filegroup, add some non-clustered indexes, and then add a partitioned clustered indexes, the non-clustered indexes will remain on the filegroup, not on the partition scheme.
Upvotes: 2