Question

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

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?

Was it helpful?

Solution

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)

OTHER TIPS

This is to SQL Server 2005.

Syntax to drop Fulltext Index:

ALTER FULLTEXT INDEX ON [TABLENAME] DROP (COLUMNNAME)

-- ALTER COLUMN OR MORE STATEMENT --

Syntax to Readd FullText Index:

ALTER FULLTEXT INDEX ON [TABLENAME] add (COLUMNNAME)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top