—给YSZJ_CP数据库的ScreenInvestor_ACT_Son表建立全文索引

    1. use 数据库
    2. go
    3. execute sp_fulltext_database 'enable'

    —启动创建全文索引

    —判断唯一索引键是否存在,存在的话删除

    1. if (SELECT INDEXPROPERTY( OBJECT_ID('ScreenInvestor_ACT_Son'), 'PK_ScreenInvestor_ACT_Son', 'IsFulltextKey'))=1
    2. begin
    3. --print '1'
    4. DROP FULLTEXT INDEX ON ScreenInvestor_ACT_Son
    5. end

    —判断全文索引键是否存在,存在的话删除

    1. if (SELECT FULLTEXTCATALOGPROPERTY('Act_son', 'accentsensitivity')) is not null
    2. begin
    3. --print '1'
    4. DROP FULLTEXT CATALOG Act_son
    5. END

    —声明全文索引键

    1. execute sp_fulltext_catalog 'Act_son','create'
    2. execute sp_fulltext_table 'ScreenInvestor_ACT_Son','create','Act_son','PK_ScreenInvestor_ACT_Son'

    —将唯一索引和全文索引进行绑定声明
    —插入该表的全文索引目录

    1. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','Abbreviation','add'
    2. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','ACT','add'
    3. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','Agenda','add'
    4. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','CreditCode','add'
    5. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','FoundationName','add'
    6. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','Genre','add'
    7. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','ProvincialLevel','add'
    8. execute sp_fulltext_column 'ScreenInvestor_ACT_Son','SourceTable','add'

    —激活全文索引目录

    1. execute sp_fulltext_table 'ScreenInvestor_ACT_Son','activate'

    —填充该表的全文索引

    1. execute sp_fulltext_catalog 'Act_son','start_full'