Pues ahi tienen que le di drop a mi tabla (respaldando la
informacion de la misma), la volvi a crear, no sin antes
colocar en ON el ANSI_NULLS.
Al momento de crear la vista con la opcion: WITH
SCHEMABINDING
Todo bien, pero al momento de crear el indice:
CREATE UNIQUE CLUSTERED INDEX key_view_1403 ON
view_1403_MI_other (HORA, MINUTO)
Me envia este error:
Server: Msg 1936, Level 16, State 1, Line 1
Cannot index the view 'view_1403_MI_other' It contains one
or more disallowed constructs.
Este es el script de mi vista:
CREATE view view_1403_MI_other
WITH SCHEMABINDING
AS
SELECT DATEPART(hh,fd_FileInputDateTime) AS HORA,
DATEPART(mi,fd_FileInputDateTime) AS MINUTO,
COUNT(fb_InputFileStatus) as TOTAL
FROM dbo.file_1403
WHERE fd_FileInputDateTime BETWEEN CONVERT(CHAR
(10),GETDATE(),120)+' 00:00:00' AND DATEADD(MI,-3,GETDATE
())
AND fb_InputFileStatus = 1
GROUP BY datepart(hh,fd_FileInputDateTime), datepart
(mi,fd_FileInputDateTime)
Estoy metido en un lio.
Cualquier comentario, gracias.
Leer las respuestas