Cannot find index error

  • Due to large import function, I would like to disable my constraints.

    The query I use is

    ALTER INDEX ALL ON [table_name] Disable.

    The disabling part runs successfully when I try to enable them it passes error:

    Cannot find Index <index_name>

    The command I use

    ALTER INDEX ALL ON [table_name] Rebuild.

    I even tried

    ALTER INDEX <index_name> ON [table_name] Rebuild

    and

    ALTER INDEX <index_name> ON [schema_name].[table_name] Rebuild

    But all fails.

    When i query sysobjects and INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE the Fk constraint do exist there.

    what is that I miss

  • It would help me to understand, if u can post the list of indexes on the table as well as the error u r getting while trying to enable the indexes..

  • You may try to use "CREATE INDEX WITH DROP_EXISTING" to enable indexes: http://technet.microsoft.com/en-us/library/ms177406.aspx.

    Be carefull when you disable ALL indexes, disabling a clustered index on a table prevents access to the data.

  • yes, i can use Create Index with Drop existing and it is working fine.

    But I still dont understand what is wrong with the former statement.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply