为什么要“改变表切换分区”? 默默地失败?
我在 SQL Server 2005(Ent,Ed.,32 位,SP2)上有一个分区事实表,我正在为其构建分区(事实表是快照类型)。 该过程在单独的表中构建数据,应用适当的索引,然后将分区切换到表中。
这在过去有效
表结构是相同的,并且命令不会引发错误。 如果您删除其中一个索引,它将引发一个错误,抱怨这一点。
由于某种原因,切换分区的命令不会引发错误,但会默默失败。 我不明白为什么会出现这种情况。
例如,
alter table wk.FactRIAgedDebt
switch partition 12
to fact.RIAgedDebt partition 12
运行时,SSMS 报告“命令已成功完成。
”,但运行诸如 select count (*) from fact.RIAgedDebt
之类的内容会返回 0 行。 源表 wk.FactRIAgedDebt
中仍然包含数据。
- 这是一个已知的错误吗?
- 我做错了什么明显的事情吗?
- 有人见过这种现象吗?
I have a partitioned fact table on a SQL Server 2005 (Ent, Ed., 32 bit, SP2) that I am constructing a partition for (the fact table is a snapshot type). The process builds the data in a separate table, applies appropriate indexes and then switches the partition into the table.
This has worked in the past
The table structures are identical and the command raises no errors. If you drop one of the indexes it will raise an error complaining about that.
For some reason the command to switch the partition raises no errors but fails silently. I cannot see why this might be the case.
For example,
alter table wk.FactRIAgedDebt
switch partition 12
to fact.RIAgedDebt partition 12
Runs, with SSMS reporting 'Command (s) completed successfully.
' but running something such as select count (*) from fact.RIAgedDebt
returns 0 rows. The source table wk.FactRIAgedDebt
still has the data in it.
- Is it a known bug?
- Am I doing something obvious wrong?
- Has anyone seen this phenomenon before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答:使用了错误的分区函数来获取分区号。 噢!
Answer: using the wrong partition function to get the partition number. D'oh!