I have a table Tally (Heap Table) having no Index , No Key , No Constraint at all on a table .
Total count of rows is 11856655
Can anyone please help me understand below :
I am using below query to get the complete output of this table and below is the output .
select top 10 from table
As I mentioned it has no Index , No Primary Key Constraint .
In this case :
I am trying to create a Clustered Index / Primary Key but I am getting below Issues .
ALTER TABLE [abc].[Table] ADD CONSTRAINT [PK_SectionD] PRIMARY KEY CLUSTERED ( sectionID ASC) ON [PRIMARY]
Msg 1505, Level 16, State 1, Line 1 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'Table' and the index name 'PK_SectionID'. The duplicate key value is (24200901). Msg 1750, Level 16, State 0, Line 1 Could not create constraint or index. See previous errors. The statement has been terminated.
Also I created a Clustered Index on SectionID successfully but no use at all :
CREATE CLUSTERED INDEX ON Table (SectionID)
Still no use , it takes close to 2 Minutes and 55 seconds ...
Please help me what else I can do to speed up execution .