
/* drop existing PK constraint, indexes */

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

GO

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

ALTER TABLE [dbo].[DT502] ADD  CONSTRAINT [PK_DT502] PRIMARY KEY CLUSTERED 
(
	[DI024175] ASC,
	[DI024176] 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 [PK_covering_query] ON [dbo].[DT502] 
(
	[DI024175] ASC,
	[DI024176] ASC
)
INCLUDE ( [DI028073]) 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 [FK_DT500] ON [dbo].[DT502] 
(
	[DI024175] ASC
)
INCLUDE ( [DI024176],
[DI028073]) 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 [FK_DT410] ON [dbo].[DT502] 
(
	[DI024176] ASC
)
INCLUDE ( [DI024175],
[DI028073]) 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
