If (select databaseproperty (db_name (), n'isfulltextenabled ') <> 1
Exec sp_fulltext_database n 'enable'
Go
If not exists (select * From DBO. sysfulltextcatalogs where name = n'q _ product ')
Exec sp_fulltext_catalog n 'q _ product', n'create'
Go
If (select databaseproperty (db_name (), n'isfulltextenabled ') <> 1
Exec sp_fulltext_database n 'enable'
Go
If not exists (select * From DBO. sysfulltextcatalogs where name = n'q _ product ')
Exec sp_fulltext_catalog n 'q _ product', n'create'
Go
-- C_product indicates the table name and pk_c_product indicates the index name (to be unique)
Exec sp_fulltext_table n' [DBO]. [c_product] ', n' create', n' Q _ product', n' pK _ c_product'
Go
-- Columns of the full-text index to be created by typemark
Exec sp_fulltext_column n '[DBO]. [c_product]', N 'typemark', N 'add', 2052
Go
Exec sp_fulltext_table n' [DBO]. [c_product] ', n' activate'
Go
Exec sp_fulltext_catalog 'q _ product', 'start _ full'
Go
Exec sp_fulltext_table n' [DBO]. [c_product] ', n' start _ change_tracking'
Go
Exec sp_fulltext_table n' [DBO]. [c_product] ', n' start _ background_updateindex'
Go
Exec sp_fulltext_table n' [DBO]. [c_product] ', n' update _ Index'
Go