Ignoring indexes upon data modification?

  • Is there any way to ignore the indexes when attempting to update the design of a VARCHAR value?

    I'm attemping to increase the length of a character value located in multiple tables. Those tables have many indexes associated with them. By utilizing the below commands I'm able to ignore the constraints and triggers:

    EXEC sp_msforeachtable "ALTER TABLE ... NOCHECK CONSTRAINT all"

    EXEC sp_msforeachtable "ALTER TABLE ... DISABLE TRIGGER all"

    Is there anything similar for indexes?

  • I don't believe so. The indexes would need, potentially, to have the updated information in them. I'd hope that an increase in the varchar size, without new data, wouldn't touch data.

  • You can drop or disable the index. Disabling it deletes the entire index tree structure, just leaves the metadata behind. You'll have to rebuild the index to re-enable it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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