Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 altering a index the one sql statement

Author  Topic 

redbrad0
Posting Yak Master

176 Posts

Posted - 2008-05-12 : 22:31:24
I do not have direct access to the SQL Server database, so any querys I have to run the ASP to add/drop information from the database.

I have a index on FORUM_TOPICS called FORUM_TOPICS1 which I would like to add one more column to but I can not seem to figure out the SQL. Here is the info that this index is built with

Name: FORUM_TOPICS1
COLUMNS: FORUM_ID, T_LAST_POST
Index Options: Clustered index
File Group: Primary

I would like to add the column T_STICKY to the index. Can someone help me with the SQL to do this?

Quality NT Web Hosting & Design

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-12 : 23:55:56
You need to drop your existing index using DROP INDEX and then recreate the index with new column using ALTER TABLE ADD INDEX for this.

If you are uing SQL 2005, you also have an ALTER INDEX statement.
Look into books online for explanations.
Go to Top of Page
   

- Advertisement -