在所有列上创建全文索引脚本,而不按名称指定每列

时间:2013-04-08 06:10:09

标签: sql-server sql-server-2008 full-text-indexing

如何在不通过SQL Server脚本指定单个列名的情况下在所有列上都有完整的文本索引?

我的表有50列,我希望全文索引能够覆盖它们。

可以这样做吗?

1 个答案:

答案 0 :(得分:0)

CREATE FULLTEXT INDEX ON table_name
   [ ( { column_name 
             [ TYPE COLUMN type_column_name ]
             [ LANGUAGE language_term ] 
             [ STATISTICAL_SEMANTICS ]
        } [ ,...n] 
      ) ]
    KEY INDEX index_name 
    [ ON <catalog_filegroup_option> ]
    [ WITH [ ( ] <with_option> [ ,...n] [ ) ] ]
[;]

<catalog_filegroup_option>::=
 {
    fulltext_catalog_name 
 | ( fulltext_catalog_name, FILEGROUP filegroup_name )
 | ( FILEGROUP filegroup_name, fulltext_catalog_name )
 | ( FILEGROUP filegroup_name )
 }

<with_option>::=
 {
   CHANGE_TRACKING [ = ] { MANUAL | AUTO | OFF [, NO POPULATION ] } 
 | STOPLIST [ = ] { OFF | SYSTEM | stoplist_name }
 | SEARCH PROPERTY LIST [ = ] property_list_name 
 }

请参阅MSDN:

http://msdn.microsoft.com/en-us/library/ms187317.aspx

同时参考这个问题:

Trying to set up Full Text Search for SQL Server Via Script