문제

I have address table in which city field have nvarchar datatype, but I want to change datatype nvarchar to varchar. For that I have write the script

ALTER TABLE Address ALTER COLUMN City varchar(50) null

but when I execute this I have got the error message:

Msg 7614, Level 16, State 1, Line 1 Cannot alter or drop column 'City' because it is enabled for Full-Text Search.

So how can I resolve this error? I don't know anything about full text search.

도움이 되었습니까?

해결책

You probably have a full text index on the table and that is not allowing you to alter a column with that.

So you can try:

DROP FULLTEXT INDEX ON Address

And then try:

ALTER TABLE Address ALTER COLUMN City varchar(50) null

And then you have to see what the index contains and recreate it

다른 팁

It would be wiser to check the contents of the full text index first before dropping it.

Also you might be better off using the following code instead:

ALTER FULLTEXT INDEX ON tableName  DROP (ColumnName)

This will remove the fulltext index on only that column.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top