0
我正在使用SQL Server 2008.我有兩個100個分區表,它們的結構相同,分區架構/功能和相同的文件組。目標表分區爲空,但alter table switch仍然失敗,說明目標分區必須爲空
表結構:
Create table source_table
(
id int,
XmlData xml,
Partitionkey ([id]%(100)) As Persisted
)
Create table Destination_table
(
id int,
XmlData xml,
Partitionkey ([id]%(100)) As Persisted
)
要求:
Destination_table
具有記錄,但隔板23是空的。我需要將Source_table
的分區23記錄移動到Destination_table
。
ALTER TABLE Source_table
SWITCH partition 23 TO Destination_table partition 23
我得到一個錯誤
ALTER TABLE SWITCH失敗。 Destination_table的目標分區23必須爲空。
destination_table
的分區23已經是空的。
Select count(1)
from destination_table
返回0
那麼爲什麼會出現這樣的錯誤?