Síntomas
Suponga que tiene una tabla que contiene una columna de tipo de datos de fecha y ha implementado el índice de almacén de columnas agrupadas (CCSI) en esta tabla de Microsoft SQL Server 2014. Al intentar consultar la tabla con el tipo de datos de fecha como cualificador, se pueden devolver datos incorrectos. Por ejemplo:create table tab2(c1 int, c2 date, c3 varchar(10)) CREATE CLUSTERED COLUMNSTORE INDEX [CCI_tab2] ON [tab2] WITH (DROP_EXISTING = OFF)GO select *FROM tab2 S -- Table with clustered columnstore indexWHERE S.c2 = @date -- variable of Date datatype
Resolución
Información de Service Pack
Para resolver este problema, obtenga el Service Pack 1 para SQL Server 2014.
Para obtener más información sobre el Service Pack 1 (SP1) de SQL Server 2014, consulte errores corregidos en el Service Pack 1 de SQL server 2014.
Información de actualización acumulativa
Este problema se solucionó por primera vez en la siguiente actualización acumulativa de SQL Server.
Cada actualización acumulativa para SQL Server contiene todas las revisiones y todas las revisiones de seguridad incluidas en la actualización acumulativa anterior. Consulte las últimas actualizaciones acumulativas para SQL Server:
Más información
Use el código siguiente para reproducir este problema:create table tab1(c1 int, c2 date) insert into tab1values (1 , '2000-01-01') CREATE NONCLUSTERED INDEX [idxtab1c2] ON tab1( c2 ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) create table tab2(c1 int, c2 date, c3 varchar(10)) insert into tab2values (1, '2000-01-01', 'test') CREATE CLUSTERED COLUMNSTORE INDEX [CCI_tab2] ON [tab2] WITH (DROP_EXISTING = OFF)GO create table t([runId] int not null, [scalingFactor] float not null) -- REPRO QUERY. Below batch is expected to return a row but we don’t get ittruncate table tDECLARE @date DATE, @numDates INT INSERT INTO t VALUES(1, 1)DECLARE @date DATE, @numDates INTSELECT @date = max(R.c2) , @numDates = COUNT(distinct R.c2)FROM tab1 R INNER JOIN t D ON R.c1 = D.runId select *FROM tab2 S -- CCIWHERE S.c2 = @date
Estado
Microsoft ha confirmado que se trata de un problema de los productos de Microsoft recogidos en la sección "Se aplica a".