x
login about faq Site discussion (meta-askssc)

Script to Enable and Dsable Indexes on a table

Is there a script that I can use to activate and deactivate Indexes on a table

more ▼

asked Jan 18 '12 at 03:49 AM in Default

HRugbeer gravatar image

HRugbeer
91 8 12 19

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

alter index [indexname] on [tablename] disable

more ▼

answered Jan 18 '12 at 04:13 AM

Wilfred van Dijk gravatar image

Wilfred van Dijk
549 13 18 20

Thanks.

This mabe a silly question but how would I enable it again.

I assume you change the disable to enable like below but then I get a sytax error

alter index [indexname] on [tablename] enable

Jan 18 '12 at 04:21 AM HRugbeer

You need to Rebuild the index, to enable it again. Please see BOL for more help.

Jan 18 '12 at 05:06 AM Usman Butt
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x272
x224
x70

asked: Jan 18 '12 at 03:49 AM

Seen: 660 times

Last Updated: Jan 19 '12 at 02:45 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.