I'm writing an SQL data updater to convert old text/ntext/image type columns into varchar/nvarchar/varbinary. The updaters are run within transactions when the system boots to update the database from an older version. I've gotten the SQL to work on its own, but a handful of the columns being changed were full-text indexed, which means I can't alter their type without first dropping the index, like so:
ALTER FULLTEXT INDEX ON Table DROP (Column)
exec dbo.ConvertDataType 'Table', 'Column', 'nvarchar(max)'
ALTER FULLTEXT INDEX ON Table ADD (Column)
Problem is that the first line does not work in the data updater because of the error "ALTER FULLTEXT INDEX statement cannot be used inside a user transaction." Is there any way to make this happen within the transaction? Either by making this code work, or changing the index to the new type in some other way?