如何编写全文目录?

时间:2017-08-24 09:01:32

标签: sql-server full-text-search

我有一个FTC,包括5个表的5个全文索引。 我需要使用T-SQL脚本将PK和FK:id INT转换为这些表中的id BIGINT。 当然,服务器需要使用这些ID删除表的FTI。 如何在脚本开始时编写FTI脚本,然后在脚本结束时进行转换并在FTC中恢复完全相同的FTI?

1 个答案:

答案 0 :(得分:1)

这个怎么样(注意这只是FTI部分,我相信你已经有了列类型转换脚本):

alter fulltext index on table1 disable
-- below line is optional
alter fulltext index on table1 drop ([any_fti_column_you_need_to_change])
-- convert your columns from INT to BIGINT, note with PKs it may not be that simple
alter fulltext index on table1 
    add ([any_column_you_dropped_and_changed_which_was_a_part_of_fti])
alter fulltext index on table1 enable

HTH