如何在sql server中的列上禁用全文搜索?

时间:2021-11-28 07:18:56

I'm trying to convert a column from ntext to nvarchar(MAX), but it seems there is a Full-Text search enabled on it.

我正在尝试将列从ntext转换为nvarchar(MAX),但似乎启用了全文搜索。

Alter table <table> alter column <column> nvarchar

Then i'm going to force the text into rows

然后我要强制文本成行

update <table> set <column> = <column> +'' where <column> is not null    

Finally I'll need to enable the full text search again.

最后,我需要再次启用全文搜索。

How do I do this in SQL?

我如何在SQL中执行此操作?

2 个解决方案

#1


DROP FULLTEXT INDEX ON mytable.mycolumn;
go
Alter table ... nvarchar(value);
go
ADD FULLTEXT INDEX ON mytable add (mycolumn)

(http://msdn.microsoft.com/en-us/library/ms188359.aspx)

#2


This is to SQL Server 2005.

这是SQL Server 2005。

Syntax to drop Fulltext Index:

ALTER FULLTEXT INDEX ON [TABLENAME] DROP (COLUMNNAME)

更改[TABLENAME] DROP(COLUMNNAME)上的FULLTEXT索引

-- ALTER COLUMN OR MORE STATEMENT --

- ALTER COLUMN或更多声明 -

Syntax to Readd FullText Index:

ALTER FULLTEXT INDEX ON [TABLENAME] add (COLUMNNAME)

ALT FULLTEXT INDEX ON [TABLENAME] add(COLUMNNAME)

#1


DROP FULLTEXT INDEX ON mytable.mycolumn;
go
Alter table ... nvarchar(value);
go
ADD FULLTEXT INDEX ON mytable add (mycolumn)

(http://msdn.microsoft.com/en-us/library/ms188359.aspx)

#2


This is to SQL Server 2005.

这是SQL Server 2005。

Syntax to drop Fulltext Index:

ALTER FULLTEXT INDEX ON [TABLENAME] DROP (COLUMNNAME)

更改[TABLENAME] DROP(COLUMNNAME)上的FULLTEXT索引

-- ALTER COLUMN OR MORE STATEMENT --

- ALTER COLUMN或更多声明 -

Syntax to Readd FullText Index:

ALTER FULLTEXT INDEX ON [TABLENAME] add (COLUMNNAME)

ALT FULLTEXT INDEX ON [TABLENAME] add(COLUMNNAME)