提示 (Transact-SQL)Hints (Transact-SQL)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

提示是指定的强制选项或策略,由 SQL ServerSQL Server 查询处理器针对 SELECT、INSERT、UPDATE 或 DELETE 语句执行。Hints are options or strategies specified for enforcement by the SQL ServerSQL Server query processor on SELECT, INSERT, UPDATE, or DELETE statements. 提示将覆盖查询优化器可能为查询选择的任何执行计划。The hints override any execution plan the query optimizer might select for a query.

注意

由于 SQL ServerSQL Server 查询优化器通常会为查询选择最佳执行计划,因此建议仅在最后迫不得已的情况下才可由资深的开发人员和数据库管理员使用 <join_hint>、<query_hint> 和 <table_hint>。Because the SQL ServerSQL Server query optimizer typically selects the best execution plan for a query, we recommend that <join_hint>, <query_hint>, and <table_hint> be used only as a last resort by experienced developers and database administrators.

本节将介绍下列提示:The following hints are described in this section: