Error: Cannot alter or drop column 'x' because it is enabled for Full-Text Search

前端 未结 2 1823
轻奢々
轻奢々 2021-02-19 08:32

I\'m refactoring an old database and removing columns no longer in use. The DB used to have full text indexing, so, some column are marked for full text.

How ca

相关标签:
2条回答
  • 2021-02-19 09:16

    I know this is an old post,I got stuck up,where i had to alter a column in table rather than drop.below code worked for me...

    EXEC sp_fulltext_column       //Drop your column from full text search here
    @tabname =  '<table_name>' , 
    @colname =  '<column_name>' , 
    @action =  'drop' 
    
     ALTER TABLE ... //Alter your column here
    
    EXEC sp_fulltext_column       //Add your column back to full text search
    @tabname =  '<table_name>' , 
    @colname =  '<column_name>' , 
    @action =  'add' 
    
    0 讨论(0)
  • 2021-02-19 09:18

    Found the solution myself:

    -- You should call the DISABLE command 
    ALTER FULLTEXT INDEX ON TableName DISABLE
    ALTER FULLTEXT INDEX ON TableName DROP (ColumnName)
    ALTER TABLE TableName DROP COLUMN ColumnName
    
    0 讨论(0)
提交回复
热议问题