KILL STATS JOB (Transact-SQL)KILL STATS JOB (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 中的异步统计信息更新作业。Terminates an asynchronous statistics update job in SQL ServerSQL Server.

主题链接图标 Transact-SQL 语法约定Topic link icon Transact-SQL Syntax Conventions

语法Syntax

KILL STATS JOB job_id   

备注

若要查看 SQL Server 2014 及更早版本的 Transact-SQL 语法,请参阅早期版本文档To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.

参数Arguments

job_idjob_id
job_id 字段,由该作业的 sys.dm_exec_background_job_queue 动态管理视图返回。Is the job_id field returned by the sys.dm_exec_background_job_queue dynamic management view for the job.

备注Remarks

job_id 与在其他形式的 KILL 语句中所使用的 session_id 或工作单元无关。The job_id is unrelated to session_id or unit of work used in other forms of the KILL statement.

权限Permissions

若要从 sys.dm_exec_background_job_queue 动态管理视图访问信息,用户必须具有 VIEW SERVER STATE 权限。User must have VIEW SERVER STATE permission to access information from the sys.dm_exec_background_job_queue dynamic management view.

默认情况下,sysadmin 和 processadmin 固定数据库角色的成员具有 KILL STATS JOB 权限,并且该权限不可转移。KILL STATS JOB permissions default to the members of the sysadmin and processadmin fixed database roles and are not transferable.

示例Examples

以下示例演示如何终止与 job_id = 53 的作业关联的统计信息更新。The following example shows how to terminate the statistics update associated with a job where the job_id = 53.

KILL STATS JOB 53;  
GO  

另请参阅See Also

KILL (Transact-SQL) KILL (Transact-SQL)
KILL QUERY NOTIFICATION SUBSCRIPTION (Transact-SQL) KILL QUERY NOTIFICATION SUBSCRIPTION (Transact-SQL)
sys.dm_exec_background_job_queue (Transact-SQL) sys.dm_exec_background_job_queue (Transact-SQL)
统计信息Statistics