[英]Is there a way to drop a range value from a partition table (sql server 2012)
[英]Creating a table with date as range partition in SQL Server 2012
我是SQL Server编码的新手。 请让我知道如何在SQL Server中创建日期范围分区的表
以下是teradata中类似的语法(创建的表以订单日期为2012年的范围分区,每天为单个分区)
CREATE TABLE ORDER_DATA (
ORDER_NUM INTEGER NOT NULL
,CUST_NUM INTEGER
,ORDER_DATE DATE
,ORDER_TOT DECIMAL(10,2)
)
PRIMARY INDEX(ORDER_NUM)
PARTITION BY (RANGE_N ( ORDER_DATE BETWEEN DATE ‘2012-01-01’ AND DATE 2012-12-31 EACH INTERVAL ‘1’ DAY));
提前致谢
MSDN上描述了创建分区表的过程,如下所示:
Creating a partitioned table or index typically happens in four parts: 1. Create a filegroup or filegroups and corresponding files that will hold the partitions specified by the partition scheme. 2. Create a partition function that maps the rows of a table or index into partitions based on the values of a specified column. 3. Create a partition scheme that maps the partitions of a partitioned table or index to the new filegroups. 4. Create or modify a table or index and specify the partition scheme as the storage location.
您可以在MSDN上找到代码示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.