sys.plan_guides (Transact-SQL)sys.plan_guides (Transact-SQL)

适用于: 是SQL Server是Azure SQL 数据库否Azure SQL 数据仓库否并行数据仓库APPLIES TO: yesSQL Server yesAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

数据库中的每个计划指南都在表中对应一行。Contains a row for each plan guide in the database.

列名Column name 数据类型Data type 描述Description
plan_guide_idplan_guide_id intint 数据库中计划指南的唯一标识符。Unique identifier of the plan guide in the database.
namename sysnamesysname 计划指南的名称。Name of the plan guide.
create_datecreate_date datetimedatetime 计划指南的创建日期和时间。Date and time the plan guide was created.
modify_datemodify_date 日期时间Datetime 上次修改计划指南的日期。Date the plan guide was last modified.
is_disabledis_disabled bitbit 1 = 禁用计划指南。1 = Plan guide is disabled.

0 = 启用计划指南。0 = Plan guide is enabled.
query_textquery_text nvarchar(max)nvarchar(max) 创建计划指南所依据的查询文本。Text of the query on which the plan guide is created.
scope_typescope_type tinyinttinyint 标识计划指南的作用域。Identifies the scope of the plan guide.


2 = SQL2 = SQL

scope_type_descscope_type_desc nvarchar(60)nvarchar(60) 计划指南作用域的说明。Description of scope of the plan guide.



scope_object_idscope_object_id IntInt 如果作用域为 OBJECT,则为定义计划指南作用域的对象的 object_id。object_id of the object defining the scope of the plan guide, if the scope is OBJECT.

如果计划指南的作用域不是 OBJECT,则其值为 NULL。NULL if the plan guide is not scoped to OBJECT.
scope_batchscope_batch nvarchar(max)nvarchar(max) 批处理文本,如果scope_type是 SQL。Batch text, if scope_type is SQL.

如果批处理类型不是 SQL,则其值为 NULL。NULL if batch type is not SQL.

如果为 NULL 并且scope_type是 SQL 的值query_text适用。If NULL and scope_type is SQL, the value of query_text applies.
参数parameters nvarchar(max)nvarchar(max) 定义与计划指南关联的参数列表的字符串。The string defining the list of parameters associated with the plan guide.

NULL = 没有与计划指南关联的参数列表。NULL = No parameter list is associated with the plan guide.
提示hints nvarchar(max)nvarchar(max) 与计划指南关联的 OPTION 子句提示。The OPTION clause hints associated with the plan guide.


目录视图中仅显示用户拥有的安全对象的元数据,或用户对其拥有某些权限的安全对象的元数据。The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. 有关详细信息,请参阅 Metadata Visibility ConfigurationFor more information, see Metadata Visibility Configuration.

请参阅See Also

目录视图 (Transact-SQL) Catalog Views (Transact-SQL)
sp_create_plan_guide (Transact-SQL) sp_create_plan_guide (Transact-SQL)
sp_create_plan_guide_from_handle (Transact-SQL)sp_create_plan_guide_from_handle (Transact-SQL)