Pregunta

I have a Table with the following columns

ID (INT Primary Key)
RecordDate (DateTime non-unique)
Name (varchar)

I have partitioned the table based on field RecordDate (Monthly) to different file groups.

Now, how can I add a primary key ID to this partitioned scheme with out combining field with RecordDate?

¿Fue útil?

Solución

The short answer is that your primary key cannot be clustered if you don't want to include your partition column in your primary key as a composite column. So create a clustered index on the partition scheme for RecordDate. Then when you create your primary key constraint, set it to nonclustered.

Please note this can degrade performance and cause memory contention, and is generally not recommended.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top