Copy Code code as follows:
--View the current database state 1 to have full-text indexing enabled
SELECT databaseproperty (' Database name ', ' isfulltextenabled ')
--Open Fulltext function
Execute sp_fulltext_databse ' Enable '
--Turn off this feature
Execute sp_fulltext_databse ' disable '
--Create a full-text indexed catalog
--Delete full-text catalog drop fulltext directory name
CREATE Fulltext CATALOG Directory name
--Each table can have only one full-text index, stored in the specified index directory, can be created through the wizard, or it can be created through SQL
--IndexName refers to an existing unique index name based on a specified table. Instead of a unique index column name. If the index does not exist, you need to create a unique index first.
--Delete Full-text index drop FULLTEXT index on table name
CREATE Fulltext INDEX on name
(index 1, index 2 ...)
Key INDEX indexname on table name
--Full-text Indexing query
Select * FROM table name
where contains (column name, ' 202* "or" 2* ")
Select * FROM table name
where FREETEXT (column name, ' 202* "and" 2* ")
* Note:
The function of the FREETEXT statement is to search for a free text format string in all columns or columns of a table, and
Returns a row of data that matches the string. Therefore, the function that the FREETEXT statement performs is also called the free-text query.
The function of the CONTAINS statement
is to search in all columns or columns of a table: a word or phrase; a word or phrase; another word close to the other
A word, a derivative of a word, a repeated occurrence of a word.
*/