Error al crear un indice !!!!???

08/04/2005 - 15:22 por Leopoldo Ramos | Informe spam
Al tratar de crear el indice a la siguiente vista me da un error:

Cannot index the view 'BDGES1.dbo.vCUBICAC'. It contains one or more
disallowed constructs.

A que se debera ?


CREATE VIEW dbo.vCUBICAC
WITH SCHEMABINDING
AS
SELECT gD.DOCUMENTO,gD.ccTOTAL, SUM(isnull(gCgD.valor,0)) as pagado,
COUNT_BIG (*) AS CNT
FROM dbo.gD left join dbo.gCgD
on gD.modulo=gCgD.moduloD and gD.tipo=gCgD.tipoD and gD.grupo=gCgD.grupoD
and gD.documento=gCgD.documentoD
GROUP BY gD.DOCUMENTO,gD.ccTOTAL

go

CREATE UNIQUE CLUSTERED INDEX documento ON [dbo].[vCUBICAC]([documento])
ON [PRIMARY]
GO

Me la crea bien pero no el indice. Dice:Cannot index the view
'BDGES1.dbo.vCUBICAC'. It contains one or more disallowed constructs.
 

Leer las respuestas

#1 Alejandro Mesa
08/04/2005 - 15:35 | Informe spam
Leopoldo,

No puedes usar LEFT OUTER JOIN en una vista indexada.


AMB


"Leopoldo Ramos" wrote:

Al tratar de crear el indice a la siguiente vista me da un error:

Cannot index the view 'BDGES1.dbo.vCUBICAC'. It contains one or more
disallowed constructs.

A que se debera ?


CREATE VIEW dbo.vCUBICAC
WITH SCHEMABINDING
AS
SELECT gD.DOCUMENTO,gD.ccTOTAL, SUM(isnull(gCgD.valor,0)) as pagado,
COUNT_BIG (*) AS CNT
FROM dbo.gD left join dbo.gCgD
on gD.modulo=gCgD.moduloD and gD.tipo=gCgD.tipoD and gD.grupo=gCgD.grupoD
and gD.documento=gCgD.documentoD
GROUP BY gD.DOCUMENTO,gD.ccTOTAL

go

CREATE UNIQUE CLUSTERED INDEX documento ON [dbo].[vCUBICAC]([documento])
ON [PRIMARY]
GO

Me la crea bien pero no el indice. Dice:Cannot index the view
'BDGES1.dbo.vCUBICAC'. It contains one or more disallowed constructs.



Preguntas similares