SQL Server creates a full-text index

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.