SQL Server 2005 Simple Full-text search _mssql2005

Source: Internet
Author: User

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.
*/

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.