在向表中插入新行时,我遇到了字符数据转换的神秘错误。故障排除表明过滤索引是问题的根源。
索引的过滤器使用 DateTime 列,该列也是表的分区列。一些客户端默认与俄语连接并收到错误消息。我设法在测试表上重现它。
有没有人对为什么会发生这种情况有任何想法?
use YOUR_DATABASE ;
go
select @@VERSION ;
-- Microsoft SQL Server 2016 (SP2-CU1) ...
-----------------------------------------------------------------------------
-- CREATE DATETIME PARTITIONED TABLE
set language english ;
drop table if exists dbo.test_of_filtered_idx ;
drop partition scheme ps_test_of_filtered_idx ;
drop partition function pf_test_of_filtered_idx ;
go
set language english ;
go
create partition function pf_test_of_filtered_idx (datetime)
as range right
for values ('1999-11-01 00:00:00.000' , '1999-12-01 00:00:00.000' , '2000-01-01 00:00:00.000' , '2000-02-01 00:00:00.000')
create partition scheme ps_test_of_filtered_idx
as partition pf_test_of_filtered_idx
ALL …Run Code Online (Sandbox Code Playgroud)