Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Include columns after creating an index


Include columns after creating an index

Author
Message
Zsolt Szabo
Zsolt Szabo
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 17
I need to include columns to an index after creating it. So I need to replace this command

CREATE INDEX
[INDEX01] ON [TABLE01] (Column01, Column02, Column03)
INCLUDE (Column04, Column05, Column06, Column07)

with

CREATE INDEX
[INDEX01] ON [TABLE01] (Column01, Column02, Column03)

and somehow include necessary columns after this command.

Could you help me, please?
Andras Belokosztolszki
Andras Belokosztolszki
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1387 Visits: 1585
Zsolt Szabo (4/10/2008)
I need to include columns to an index after creating it. So I need to replace this command

CREATE INDEX
[INDEX01] ON [TABLE01] (Column01, Column02, Column03)
INCLUDE (Column04, Column05, Column06, Column07)

with

CREATE INDEX
[INDEX01] ON [TABLE01] (Column01, Column02, Column03)

and somehow include necessary columns after this command.

Could you help me, please?



You cannot change the columns in an index using an ALTER INDEX statement, so what you will have to do is:
DROP INDEX INDEX01
CREATE INDEX INDEX01 .. with the columns you wish the index had

Regards,
Andras



Andras Belokosztolszki, MCPD, PhD
GoldenGate Software
Zsolt Szabo
Zsolt Szabo
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 17
I hoped I can make it without dropping.
Thanks for the answer.
shamshudheen
shamshudheen
SSC-Enthusiastic
SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)SSC-Enthusiastic (120 reputation)

Group: General Forum Members
Points: 120 Visits: 211
Use ALTER INDEX to perform the following maintenance tasks for a Text index:

Rename the index.

Rebuild the index using different preferences. .

Resume a failed index operation (creation/optimization). .

Process DML in batch (synchronize). .

Optimize the index. .

Add stopwords to the index. .

check this link for more detail

http://lbd.epfl.ch/f/teaching/courses/oracle8i/inter.815/a67843/csql.htm#14189


I dont think u can add are change fields to indexed, best is drop and recreate again
Zsolt Szabo
Zsolt Szabo
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 17
Yes that is what I did. Recreated the indexes. Fortunately I don't have to do it too often so it's a good solution for me. Thanks.
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