注意: 您可以复制此练习中所用的脚本,这些脚本位于 C:\SQL(SQL Server培训 mySQL培训 )HOLS\Partitioning\Solution\Partition
Processing 文件夹中的 Partition Processing.ssmssln 解决方案中。
1.为存档表创建分区函数
(1)在解决方案资源管理器中,右键单击该连接,然后单击新建查询。
(2)右键单击 SQLQuery1.sql,然后单击重命名。
(3)键入 Create Archive Partition Function.sql,然后按 Enter。
(4)键入下面的代码。
USE AdventureWorksDW
CREATE PARTITION
FUNCTION
pf_OrderDateKeyArchive(int)
AS RANGE RIGHT
FOR VALUES(185)
GO |