indice sorbre viste

16/05/2005 - 19:01 por Eduardo De Luca | Informe spam
Amigos, estoy tratando de montar un indice sobre una vista , sin aun poder
hacerlo.

El codigo de la vista
create view in_alta_automatica


as

select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_prc
union all
select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_pdc
union all
select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_tcv
union all
select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_mov


luego le "intento crear el indice"
CREATE INDEX [IX_in_alt_tabla] ON [dbo].[in_alta_automatica]([alt_tabla])
ON [PRIMARY]


y este es el mensaje de error:

Server: Msg 1939, Level 16, State 1, Line 1
Cannot create index on view 'in_alta_automatica' because the view is not
schema bound.

que estoy haciendo mal????
 

Leer las respuestas

#1 Alejandro Mesa
16/05/2005 - 20:47 | Informe spam
Agrega la opcion siguiente:

create view in_alta_automatica
with SCHEMABINDING
as
...
go


AMB


"Eduardo De Luca" wrote:

Amigos, estoy tratando de montar un indice sobre una vista , sin aun poder
hacerlo.

El codigo de la vista
create view in_alta_automatica


as

select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_prc
union all
select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_pdc
union all
select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_tcv
union all
select alt_tabla, alt_clave,alt_id from in_e1_alta_aut_mov


luego le "intento crear el indice"
CREATE INDEX [IX_in_alt_tabla] ON [dbo].[in_alta_automatica]([alt_tabla])
ON [PRIMARY]


y este es el mensaje de error:

Server: Msg 1939, Level 16, State 1, Line 1
Cannot create index on view 'in_alta_automatica' because the view is not
schema bound.

que estoy haciendo mal????



Preguntas similares