BUG:当分区函数包含“。”时,统计信息不能设置为增量。 (点) [英] BUG: Statistics cannot be set to incremental when the Partition Function contains a "." (dot)
问题描述
您好,
我们正在将SQL 2012数据库迁移到SQL 2016,而某些数据库包含分区表。
We are moving SQL 2012 databases to SQL 2016, and some databases contain partitioned tables.
正在使用SQL2016,我想使用增量统计信息,但是当我对现有统计信息/索引启用增量统计信息时,我总是收到以下错误:"语法不正确附近'。'。"
Being SQL2016, I want to make use of incremental statistics, but when I enable incremental statistics on the existing statistics/indexes, I always received the following error: "Incorrect syntax near '.'."
每个包含数据的分区都会出现此错误。
This error shows up for each partition that contains data.
经过大量测试后,我发现它是由分区函数的名称引起的。
这包含一个"。" ("PF_dbo.ID")。
After a lot of testing, I found out that it is caused by the name of the Partition Function.
This contains a "." ("PF_dbo.ID") .
是否有人遇到此问题并找到了解决方法而无需重建每个分区表?
这个这将需要很长时间的数据库停机,这是我想避免的。
Has anybody run into this problem and found a way to solve it without needing to rebuild each partitioned table?
This would take a long downtime of the database, and is something I would like to avoid.
我认为这是一个错误,它完全有可能创建具有"。"的分区函数。首先是名字。
当你考虑以下情况时,更有说服力这是一个错误:
I consider this being a bug and it was perfectly possible to create the partition function with a "." in the name in the first place.
It's even more convincing that this is a bug when you consider the following situation:
- 创建一个使用分区函数的表,其中包含"。"。在其名称中,以及从一开始就使用增量统计。
这完全正常,没有错误抛出。 - 在表中插入一些记录。
- 然后检查统计信息... 统计信息为空。
- Create a table that uses the Partition Function with a "." in its name, and with incremental statistics from the start.
This works perfectly, no errors thrown. - Insert some records into that table.
- Then check the statistics ... the statistic is empty.
旁注:完全没问题分区方案包含"。"。然后可以将统计信息设置为增量而不会出现问题。
Side note: it is perfectly fine that the Partition Scheme contains a ".". Stats can then be set to incremental without a problem.
在SQL2016旁边,SQL2017上也存在此问题(SQL2016在SP2 CU5上,在CU13上为SQL2017)。
Next to SQL2016, this problem is also present on SQL2017 (SQL2016 is on SP2 CU5, SQL2017 on CU13).
谢谢,
Charles
推荐答案
您是否有机会发布证明问题的完整复制品?
Any chance that you can post a complete repro that demonstrates the problem?
这篇关于BUG:当分区函数包含“。”时,统计信息不能设置为增量。 (点)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!