简体   繁体   English

ALTER TABLE SWITCH语句失败。 表中分区1定义的范围不是范围的子集

[英]ALTER TABLE SWITCH statement failed. Range defined by partition 1 in table is not a subset of range

I am getting this error whenever I am trying to switch the partition from staging to warehouse table. 每当我尝试将分区从暂存表切换到仓库表时,都会出现此错误。

ALTER TABLE SWITCH statement failed. ALTER TABLE SWITCH语句失败。 Range defined by partition 1 in table 'dbo.table1' is not a subset of range defined by partition 299 in table 'dbo.table2' 表'dbo.table1'中分区1定义的范围不是表'dbo.table2'中分区299定义的范围的子集

Please let me know the workaround to this error if anyone have gone through the same error in the past. 如果过去有人遇到过相同的错误,请告诉我该错误的解决方法。

Try this, Dissolve the last range 试试这个,溶解最后的范围

ALTER PARTITION FUNCTION <functname> MERGE RANGE (<range_of_299>)

Re-create 重新建立

ALTER PARTITION FUNCTION <functname> SPLIT RANGE (<increased_range_of_299>)

Then try SWITCH.Let me know after you tried 然后尝试SWITCH。尝试后让我知道

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server 2008中的ALTER TABLE SWITCH分区失败 - ALTER TABLE SWITCH Partition Failing In SQL Server 2008 分区图表 - 分区切换失败 - Partitioned Graph table - Partition Switch failed 为什么“更改表切换分区”会无声地失败? - Why would 'alter table switch partition' fail silently? 目标表分区为空,但更改表切换仍然失败,说明目标分区必须为空 - Destination table partition is empty but alter table switch still fails stating destination partition must be empty 将分区切换到外部表 - Switch Partition To External Table 在SQL Server 2012中创建具有日期作为范围分区的表 - Creating a table with date as range partition in SQL Server 2012 在现有范围右分区表中添加分区左边界 - add partition left boundary in an existing range right partitioned table 有没有办法从分区表中删除范围值(sql server 2012) - Is there a way to drop a range value from a partition table (sql server 2012) 如何使用开始日期输入的表定义的范围内的日期创建表 - How to Create table with Dates in range defined by table with start date inputs 在不使用 ALTER TABLE 的情况下增加 SQL Server 中表列的数字范围 - Increase numeric range of a table column in SQL Server without using ALTER TABLE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM