
/* drop existing PK constraint, indexes */

IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[DT406]') AND name = N'PID406DT406')
ALTER TABLE [dbo].[DT406] DROP CONSTRAINT [PID406DT406]

GO

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

GO

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

GO

/* create clustered index first, PK constraint second, non-clustered indexes last */

CREATE CLUSTERED INDEX [DT405_MOD+DT406_MODDA] ON [dbo].[DT406] 
(
	[DI000970] ASC,
	[DI000969] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO

ALTER TABLE [dbo].[DT406] ADD  CONSTRAINT [PK_DT406_MODDA] PRIMARY KEY NONCLUSTERED 
(
	[DI000971] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO

CREATE NONCLUSTERED INDEX [DT405_MOD] ON [dbo].[DT406] 
(
	[DI000970] ASC
)
INCLUDE ( [DI000969],
[DI000971]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

GO

/* created by database engine tuning advisor */

CREATE NONCLUSTERED INDEX [_dta_index_DT406_9_278292051__K1_2_3_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_34_35_36_37_38_44_45_46_47_48_49_] ON [dbo].[DT406] 
(
	[DI000970] ASC
)
INCLUDE ( [DI000969],
[DI000971],
[DI000982],
[DI001783],
[DI001782],
[DI001793],
[DI000157],
[DI000798],
[DI000915],
[DI001577],
[DI001578],
[DI001579],
[DI001580],
[DI001581],
[DI001582],
[DI001583],
[DI001584],
[DI001585],
[DI001586],
[DI001587],
[DI001663],
[DI006893],
[DI009341],
[DI022734],
[DI022705],
[DI025640],
[DI024599],
[DI026630],
[DI026641],
[DI026642],
[DI026656],
[DI026657],
[DI026658],
[DI027097],
[DI027566],
[DI028118],
[DI028202],
[DI028203],
[DI040867],
[DI040868],
[DI040991],
[DI059051]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]

/* Boost module listbox performance (WI 16398) */

GO
