
/* drop existing PK constraint, indexes */

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

GO

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

GO

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

GO

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

CREATE UNIQUE CLUSTERED INDEX [DT435_language_number] ON [dbo].[DT435] 
(
	[DI001550] ASC,
	[DI001538] 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].[DT435] ADD  CONSTRAINT [PK_DT435] PRIMARY KEY NONCLUSTERED 
(
	[DI001538] ASC,
	[DI001550] 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 UNIQUE NONCLUSTERED INDEX [DT435_language_number_including_text_and_length] ON [dbo].[DT435] 
(
	[DI001550] ASC,
	[DI001538] ASC
)
INCLUDE ( [DI001549],
[DI023517]) 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

CREATE UNIQUE NONCLUSTERED INDEX [DT435_PK_covering_query] ON [dbo].[DT435] 
(
	[DI001538] ASC,
	[DI001550] ASC
)
INCLUDE ( [DI001549],
[DI023517]) 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

CREATE NONCLUSTERED INDEX [DT435_number_covering_query] ON [dbo].[DT435] 
(
	[DI001538] ASC
)
INCLUDE ( [DI001550],
[DI001549],
[DI023517]) 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

CREATE NONCLUSTERED INDEX [DT435_language_covering_query] ON [dbo].[DT435] 
(
	[DI001550] ASC
)
INCLUDE ( [DI001538],
[DI001549],
[DI023517]) 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
