partition a table on a column other than the primary key

Bassam Geagea 40 Reputation points
2023-03-23T22:59:05.5033333+00:00

We have some tables and we need to partition them.

Some of our tables have a primary keys and we need to partition them on a column other than the primary key in order to truncate or drop the partition later on based on a specific retention.

can you please help us in order to do that?

Thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,778 questions
0 comments No comments
{count} votes

Accepted answer
  1. PercyTang-MSFT 12,426 Reputation points Microsoft Vendor
    2023-03-24T06:05:21.04+00:00

    Hi @Bassam Geagea

    You can refer to these two threads, which may be helpful to you.

    https://social.msdn.microsoft.com/Forums/en-US/30ac390f-f424-47b8-8960-012cfc9e835f/how-to-partition-a-table-on-a-non-primary-key-field?forum=databasedesign

    https://dba.stackexchange.com/questions/20603/does-the-partition-key-also-have-to-be-part-of-the-primary-key

    Best regards,

    Percy Tang


    If the answer is the right solution, please click "Accept Answer". If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful