
/* drop existing PK constraint, indexes */

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

GO

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

GO

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

ALTER TABLE [dbo].[DT410] ADD  CONSTRAINT [PK_DT410_DA] PRIMARY KEY CLUSTERED 
(
	[DI000198] 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 [FK_DT412_DDI] ON [dbo].[DT410] 
(
	[DI000391] ASC
)
INCLUDE ( [DI000198]) 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
