x

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, 2012 at 03:49 AM in Default

avatar image

HRugbeer
91 21 23 25

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

1 answer: sort voted first

alter index [indexname] on [tablename] disable

more ▼

answered Jan 18, 2012 at 04:13 AM

avatar image

Wilfred van Dijk
3.4k 25 35 47

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, 2012 at 04:21 AM HRugbeer

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

Jan 18, 2012 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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x414
x393
x94

asked: Jan 18, 2012 at 03:49 AM

Seen: 1306 times

Last Updated: Jan 19, 2012 at 02:45 AM

Copyright 2016 Redgate Software. Privacy Policy