Print ''
Print '-------------------------------------------------------------------------'
Print ' using Database: #DB_N#'
Print ' Table         : [Objects_tbl]'
Print ' Creation Date : 05.09.2011 18:38'
Print ' Autor         : J.Feuerstein'
Print '-------------------------------------------------------------------------'

use [#DB_N#]

Declare @MyActionMsg1 nvarchar (max)
Declare @MyTableName nvarchar (max)
set @MyTableName='Objects_tbl'


-- ALTER INDEX [Objects_tbl_IDX_PsCol02] ON [dbo].[Objects_tbl] DISABLE ALTER
-- INDEX [Objects_tbl_IDX_PsCol03] ON [dbo].[Objects_tbl] DISABLE ALTER INDEX
-- [Objects_tbl_IDX_PsCol04] ON [dbo].[Objects_tbl] DISABLE ALTER INDEX
-- [Objects_tbl_IDX_PsCol05] ON [dbo].[Objects_tbl] DISABLE ALTER INDEX
-- [Objects_tbl_IDX_PsCol06] ON [dbo].[Objects_tbl] DISABLE ALTER INDEX
-- [Objects_tbl_IDX_PsCol07] ON [dbo].[Objects_tbl] DISABLE ALTER INDEX
-- [Objects_tbl_IDX_PsCol08] ON [dbo].[Objects_tbl] DISABLE ALTER INDEX
-- [Objects_tbl_IDX_PsCol09] ON [dbo].[Objects_tbl] DISABLE ALTER INDEX
-- [Objects_tbl_IDX_PsCol10] ON [dbo].[Objects_tbl] DISABLE
-- JobMgr_11_DataTable_Objects_tbl_DropUnused_Index.sql
Print '.'

Print '-- PsCol02 ... PsCol10'
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol02')
DROP INDEX [Objects_tbl_IDX_PsCol02] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol03')
DROP INDEX [Objects_tbl_IDX_PsCol03] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol04')
DROP INDEX [Objects_tbl_IDX_PsCol04] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol05')
DROP INDEX [Objects_tbl_IDX_PsCol05] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol06')
DROP INDEX [Objects_tbl_IDX_PsCol06] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol07')
DROP INDEX [Objects_tbl_IDX_PsCol07] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol08')
DROP INDEX [Objects_tbl_IDX_PsCol08] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol09')
DROP INDEX [Objects_tbl_IDX_PsCol09] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX_PsCol10')
DROP INDEX [Objects_tbl_IDX_PsCol10] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

Print '-- ObjectFs_NE'
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX30')
DROP INDEX [Objects_tbl_IDX30] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

Print '-- Volume'
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX25')
DROP INDEX [Objects_tbl_IDX25] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

Print '-- ObjectDescription'
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX22')
DROP INDEX [Objects_tbl_IDX22] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO

Print '-- ObjectName2'
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Objects_tbl]') AND name = N'Objects_tbl_IDX23')
DROP INDEX [Objects_tbl_IDX23] ON [dbo].[Objects_tbl] WITH ( ONLINE = OFF )
GO




--------------------------------------------------------------------------------
EndeExit:
 Print ('   |-> Done on Database: #DB_N#')
 Print '------------------------------------------------------------------------'

GO
