是否可以使用2列而不是1的分区功能对表进行分区?

考虑一个3列的表格

    ID (int, primary key,
    Date (datetime),
    Num (int)

I want to partition this table by 2 columns: Date and Num.

This is what I do to partition a table using 1 column (date):

create PARTITION FUNCTION PFN_MonthRange (datetime)
AS
RANGE left FOR VALUES ('2009-11-30 23:59:59:997',
                       '2009-12-31 23:59:59:997',
                       '2010-01-31 23:59:59:997',
                       '2010-28-02 23:59:59:997',
                       '2010-03-31 23:59:59:997')
go

最佳答案

坏消息:必须在单个列上定义分区功能。

好消息:该单列可能是persisted computed column,它是您要作为分区依据的两列的组合。

关于sql-server-2008 - 使用2列进行表分区,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4671161/

10-13 02:08