错误:无法更改或删除列'x',因为它已启用全文搜索

时间:2009-06-23 19:24:40

标签: tsql sql-server-2008 full-text-search

我正在重构旧数据库并删除不再使用的列。 DB曾经有全文索引,因此,某些列标记为全文。

如何删除它们?

注意:

  • DB是MS SQL Server Express 2008
  • 不再安装全文搜索服务

修改
我试过了

ALTER FULLTEXT INDEX ON tableName  DROP (ColumnName)

但是得到了这个错误:

Full-text crawl manager has not been initialized. Any crawl started before 
the crawl manager was fully initialized will need to be restarted. Please 
restart SQL Server and retry the command. You should also check the error 
log to fix any failures that might have caused the crawl manager to fail.

2 个答案:

答案 0 :(得分:30)

自己找到解决方案:

-- 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

答案 1 :(得分:8)

我知道这是一个老帖子,我被困住了,我不得不改变表中的一列而不是下降。下面的代码对我有效...

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'