Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to alter table when full text search is enabled?

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.

like image 242
pramod Avatar asked Nov 05 '25 12:11

pramod


1 Answers

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

like image 140
Arion Avatar answered Nov 09 '25 08:11

Arion



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!