Friday, March 30, 2012

Rogue view _hypmv_0

We had difficulty dropping a table the other day as the system stated that
another object was dependant on it - this is staging database so we don't do
that kind of thing.
Investigation showed that a view _hypmv_0 had been created, this must have
been generated by the system as the box is tightly controlled and only used
by me, plus the name is a bit left-field for us.
The view had been created with the SCHEMABINDING attribute, partial DDL
follows. Can anybody shed any light on this?
Thanks,
Paul
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[_hypmv_0]') and OBJECTPROPERTY(id, N'IsView') = 1
)
drop view [dbo].[_hypmv_0]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW _hypmv_0 WITH SCHEMABINDING AS SELECTHi
Someone ran the SQL Server Index Tuning Wizard on your DB.
_hypmv_0 is an Indexed view.
Drop the view and then you can drop the table.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Paul Smith" <paul@.spamno_sagestore.com> wrote in message
news:%238J67u$cFHA.464@.TK2MSFTNGP15.phx.gbl...
> We had difficulty dropping a table the other day as the system stated that
> another object was dependant on it - this is staging database so we don't
> do that kind of thing.
> Investigation showed that a view _hypmv_0 had been created, this must have
> been generated by the system as the box is tightly controlled and only
> used by me, plus the name is a bit left-field for us.
> The view had been created with the SCHEMABINDING attribute, partial DDL
> follows. Can anybody shed any light on this?
> Thanks,
> Paul
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[_hypmv_0]') and OBJECTPROPERTY(id, N'IsView') =
1)
> drop view [dbo].[_hypmv_0]
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> SET ANSI_NULLS ON
> GO
> CREATE VIEW _hypmv_0 WITH SCHEMABINDING AS SELECT
>|||Thanks for that.
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:Oj7MOPAdFHA.1412@.TK2MSFTNGP10.phx.gbl...
> Hi
> Someone ran the SQL Server Index Tuning Wizard on your DB.
> _hypmv_0 is an Indexed view.
> Drop the view and then you can drop the table.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Paul Smith" <paul@.spamno_sagestore.com> wrote in message
> news:%238J67u$cFHA.464@.TK2MSFTNGP15.phx.gbl...
>sql

No comments:

Post a Comment