SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to Disable an index in sql server 2000


How to Disable an index in sql server 2000

Author
Message
shamshudheen
shamshudheen
SSC Veteran
SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)

Group: General Forum Members
Points: 216 Visits: 211
Hi all,

I am using SQL SERVER 200.I want to disable created indexes on a table
i tried the following sql , it throwing error

alter index FIRST_REF on tblComponentComponentJoin DISABLE

can anybody help in this is highly appreciated


Thanks

shamsudheen
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87253 Visits: 45272
There's no way to disable an index in SQL 2000. You'll have to drop it.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


shamshudheen
shamshudheen
SSC Veteran
SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)

Group: General Forum Members
Points: 216 Visits: 211
Thanks Gail Shaw

i have another question related to this topic. i am having a view of joining two table with one key and each table have multiple indexes.my question is when i run the view is it will use the indexes or not



thanks
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87253 Visits: 45272
Maybe. It depends on the queries run, the data distribution, the indexes you have. It's not a question that can be answered in general.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Grant Fritchey
Grant Fritchey
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39806 Visits: 32644
First, having an index on a table won't slow down reads of that table assuming the reads use a different index. Second, get an execution plan for the query and then you'll know which indexes it uses or doesn't. Just a reminder, while an index scan is "using" the index, it isn't necessarily using it well.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
SQLdevotee
SQLdevotee
SSC-Addicted
SSC-Addicted (426 reputation)SSC-Addicted (426 reputation)SSC-Addicted (426 reputation)SSC-Addicted (426 reputation)SSC-Addicted (426 reputation)SSC-Addicted (426 reputation)SSC-Addicted (426 reputation)SSC-Addicted (426 reputation)

Group: General Forum Members
Points: 426 Visits: 568
With Gail and Grant of course. It also depends on how you and where you are putting the [where] condition in your join. Like what Gail said, there is no general answer for this. You will have to run the query and see the execution plan and see it from there.

Imagination is more important than knowledge-Albert Einstein
shamshudheen
shamshudheen
SSC Veteran
SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)

Group: General Forum Members
Points: 216 Visits: 211
SQL King (4/17/2008)
With Gail and Grant of course. It also depends on how you and where you are putting the [where] condition in your join. Like what Gail said, there is no general answer for this. You will have to run the query and see the execution plan and see it from there.


hi

in my query i only join with keys no filter condition . i found it is still using index.Thanks Gai,Grant and Sql king for your effort
Anipaul
Anipaul
SSCertifiable
SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)

Group: General Forum Members
Points: 7301 Visits: 1407
Check this whether it works or not:

ALTER INDEX [IX_name] ON table DISABLE
GO


I don't have 2000 so I can't test it but found this solution in 2-3 sites.

Hope it works.Smile

Also read these articles:
http://blog.sqlauthority.com/2007/05/17/sql-server-disable-index-enable-index-alter-index/
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/tunesql.mspX



GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87253 Visits: 45272
Anirban Paul (4/17/2008)
Check this whether it works or not:

ALTER INDEX [IX_name] ON table DISABLE
GO



Alter Index is only 2005 and higher. 2000 didn't have the command at all.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Anipaul
Anipaul
SSCertifiable
SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)

Group: General Forum Members
Points: 7301 Visits: 1407
GilaMonster (4/18/2008)
Anirban Paul (4/17/2008)
Check this whether it works or not:

ALTER INDEX [IX_name] ON table DISABLE
GO



Alter Index is only 2005 and higher. 2000 didn't have the command at all.


As I told you I couldn't check as I found in under SQL Server 2000 in some sites. I never used it when I was using SQL Server 2000. I used to drop indexes. So when I saw in sites I thought let me put it in the forum to clear my doubts. Thanks Gail for your comment.

SmileSmile



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search