创建全文搜索查询 (Visual Database Tools)Create Full-Text Search Queries (Visual Database Tools)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse

全文搜索使用 CONTAINS 谓词来查找在给定列中包含指定文本的行。Full-text searches use the CONTAINS predicate to locate rows that have specified text in a given column. 全文搜索仅适用于具有活动的全文索引的列。Full-Text searches are only possible on columns that have active full-text indexes. 如果试图将 CONTAINS 子句用于不具有当前活动的全文索引的列,则将收到错误。If you attempt to use the CONTAINS clause on a column that does not have a currently active full-text index, you will receive an error. 有关全文检索和 CONTAINS 子句的详细信息,请参阅 全文搜索 (SQL Server)CONTAINS (Transact-SQL)For more information on full-text indexes and the CONTAINS clause, see Full-Text Search (SQL Server) and CONTAINS (Transact-SQL).

创建全文搜索查询To create a full-text search query

  1. 在解决方案资源管理器中打开一个查询或创建新的查询。Open a query from Solution Explorer or create a new one.

  2. 在该查询的 WHERE 子句中,用 CONTAINS 函数来搜索全文本列。In the WHERE clause of your query, use the CONTAINS function to search a full-text column.

另请参阅See Also

支持的查询类型 (Visual Database Tools)Supported Query Types (Visual Database Tools)
设计查询和视图操作指南主题 (Visual Database Tools)Design Queries and Views How-to Topics (Visual Database Tools)
执行基本的查询操作 (Visual Database Tools)Perform Basic Operations with Queries (Visual Database Tools)