问题描述
我想分区一个表(ResultHistory),它没有主键,没有约束,而是一个列(AuditID),它是其他表(Audit)中的主键。
I want to partition a table (ResultHistory) which has no Primary key,No Constraints but a column (AuditID) which is a primary key in other table (Audit).
RowCount ResultHistory = 6945264015
RowCount ResultHistory =6945264015
RowCount 审核 = 16793601
RowCount Audit = 16793601
表的设计 ResultHistory:
表审核设计:
推荐答案
您需要做的就是在该表上创建聚簇索引,并将该索引与相关的索引对齐分区方案。
All you need to do is create a Clustered Index on that table, and align that index with the relevant partition scheme.
一般语法是:
CREATE CLUSTERED INDEX [index_name]
ON [DBO]。[表名]([key_column_name] ASC)
ON [dbo].[table_name] ([key_column_name] ASC)
ON [Partition_Scheme_Name]([partitioned_key_column_name])
ON [Partition_Scheme_Name]([partitioned_key_column_name])
这篇关于如何对没有主键的表进行分区。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!