Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Include columns after creating an index Expand / Collapse
Author
Message
Posted Thursday, April 10, 2008 4:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 10, 2012 8:25 AM
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?
Post #482907
Posted Thursday, April 10, 2008 4:56 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 26, 2012 5:26 AM
Points: 1,367, Visits: 1,585
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
Post #482908
Posted Thursday, April 10, 2008 6:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 10, 2012 8:25 AM
Points: 3, Visits: 17
I hoped I can make it without dropping.
Thanks for the answer.
Post #482967
Posted Friday, April 11, 2008 5:13 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 10, 2009 10:50 PM
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
Post #483556
Posted Friday, April 11, 2008 5:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 10, 2012 8:25 AM
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.
Post #483560
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse