How to disable an index using select query

Posted by Murugavelmsc under Sql Server on 2/28/2013 | Points: 10 | Views : 2067 | Status : [Member] | Replies : 4
Hi Experts,

How to disable an index using select query?

Thanks,
Murugavel S

Regards,
Murugavel S
murugavel.sadagopan@gmail.com
http://murugavelmsc.blogspot.in/



Responses

Posted by: Jayakumars on: 2/28/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
murugavel

refer this

http://www.sqlservercentral.com/Forums/Topic981481-338-1.aspx

Mark as Answer if its helpful to you

Murugavelmsc, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sahoomanoj27 on: 3/14/2013 [Member] Starter | Points: 25

Up
0
Down

TRY THIS ONE

ALTER INDEX [INDEX_NAME] ON [TABLE_NAME] DISABLE


REGARDS
MANOJ SAHOO

Murugavelmsc, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhi on: 3/14/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

To disable the index :
ALTER INDEX IndexName ON TableName DISABLE




Thanks & Regards,
Santhi .V

Murugavelmsc, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/14/2013 [Member] Bronze | Points: 25

Up
0
Down
USE AdventureWorks
GO
ALTER INDEX IX_Address_StateProvinceID ON Person.Address DISABLE
GO

-- Query to check Index Usage
SELECT NAME AS [IndexName], TYPE_DESC AS [IndexType],
CASE IS_DISABLED
WHEN 0 THEN 'Enabled'
ELSE 'Disabled'
END AS [IndexUsage],
FILL_FACTOR AS [FillFactor] FROM SYS.INDEXES
WHERE OBJECT_ID = OBJECT_ID('Person.Address') ORDER BY IndexName, IndexUsage
GO

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Murugavelmsc, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response