June 6, 2015 at 3:19 pm
Comments posted to this topic are about the item Disabling Indexes
June 6, 2015 at 4:11 pm
Nice question.
To me it seems rather obvious that if you disable the clustered index then no other index on the table will work because all the other indexes identify rows the row by reference to the clustered index key (including any hidden uniquifier) for the row. So two seems a lot of points for this question. But as two of the first five answers are wrong maybe it isn't quite as obvious as it seems.
Tom
June 7, 2015 at 1:10 am
Good question & good information, thanx.
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
June 7, 2015 at 9:36 am
Nice one. As soon as I saw option #3, I selected and scored 2 points.
Thanks.
June 7, 2015 at 3:53 pm
Great question! Thanks.
Igor Micev,My blog: www.igormicev.com
June 8, 2015 at 12:31 am
In my opinion it's unimportant, if the other indexes are disabled or not. You can't reach the table data with a disabled clustered index.:-D
June 8, 2015 at 12:42 am
good question, Thanks
June 8, 2015 at 2:03 am
Strange. It looks to me that the primairy key index isn't disabled.
I scripted all 3 keys and noticed that only at the 2 non-primairy indexescript had an extra line inserted like :
ALTER INDEX [SalesArchive_NCI_SalesDate] ON [dbo].[SalesArchive] DISABLE
How can you see then that the primairy key index has been disabled ?
June 8, 2015 at 2:18 am
ArnoKwetters (6/8/2015) How can you see then that the primairy key index has been disabled ?
In the Message pane when you execute the Index disable code.
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
June 8, 2015 at 2:20 am
This was removed by the editor as SPAM
June 8, 2015 at 2:21 am
Hello Hany,
Yes you are right.
I was already a step forward.
I didn't look well in the Message pane.
Thanks.
June 8, 2015 at 2:50 am
ArnoKwetters (6/8/2015)
Strange. It looks to me that the primairy key index isn't disabled.I scripted all 3 keys and noticed that only at the 2 non-primairy indexescript had an extra line inserted like :
ALTER INDEX [SalesArchive_NCI_SalesDate] ON [dbo].[SalesArchive] DISABLE
How can you see then that the primairy key index has been disabled ?
You can also check the disabled/enabled indexes with the below query
select sys.objects.name as 'table',
sys.indexes.name as 'index',
is_disabled = case is_disabled
when '1' then 'disabled'
when '0' then 'enabled'
end
from sys.objects join sys.indexes
on sys.objects.object_id = sys.indexes.object_id
where sys.objects.name = 'SalesArchive'
June 8, 2015 at 2:54 am
Thanks PMA...
That is a nice script.
It is still strange that when I scripted the Indexed, it was not obvious that the primairy key was disabled.
This script does.
Thanks again
June 8, 2015 at 2:54 am
nice question...
Manik
You cannot get to the top by sitting on your bottom.
June 8, 2015 at 5:12 am
Good question.
Last month , I have done some tests to compare both versions 2008 R2 and 2014 and I have some problems.
2008 R2 accepts to script everything even disabled indexes , but it seems that SQL Server 2014 is more constraining as it is unable to provide the full script for all the objects of a database having disabled indexes on a table.
I have done this test with the same values for the Scripting options for 2008 R2 and 2014 with both versions 2008 R2 and 2014 of the SSMS ( Right-cclick on the database name , Tasks , Generate Scripts ) .I have done these tests to see the différences of behaviour between these both versions.
Any comment on these tests would be appreciated as I have found nothing about this difference in the forums/blogs MSDN.
Viewing 15 posts - 1 through 15 (of 27 total)
You must be logged in to reply to this topic. Login to reply