Joel Wilson
Joel Wilson

Reputation: 677

How do I write an ALTER index statement to include columns

I have an index which has include. Now I added columns to my table and I want to add those columns in INCLUDE. How do I do that?

I am currently dropping the index and recreating them. Is there any other better way since the ALTER statement doesn't have any INCLUDE option?

Upvotes: 1

Views: 122

Answers (2)

CRAFTY DBA
CRAFTY DBA

Reputation: 14935

I was curious about this one since I never have time to implement INCLUDES. Just to much other busy work.

While the MSDN link for ALTER INDEX allows you to specify other attributes like fill factor, compression, etc. The include is only used during a CREATE INDEX command.

Thus dropping and creating is your only solution.

Upvotes: 0

Su Jun-Ming
Su Jun-Ming

Reputation: 89

nope.

all you can do is recreate it.

Upvotes: 4

Related Questions