KILL STATS JOB (Transact-SQL)
Applies to: SQL Server Azure SQL Managed Instance
Terminates an asynchronous statistics update job in SQL Server.
Transact-SQL syntax conventions
Syntax
KILL STATS JOB job_id
Note
To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, see Previous versions documentation.
Arguments
job_id
Is the job_id field returned by the sys.dm_exec_background_job_queue dynamic management view for the job.
Remarks
The job_id is unrelated to session_id or unit of work used in other forms of the KILL statement.
Permissions
User must have VIEW SERVER STATE permission to access information from the sys.dm_exec_background_job_queue dynamic management view.
KILL STATS JOB permissions default to the members of the sysadmin and processadmin fixed database roles and are not transferable.
Examples
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 QUERY NOTIFICATION SUBSCRIPTION (Transact-SQL)
sys.dm_exec_background_job_queue (Transact-SQL)
Statistics
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho