{"id":253,"date":"2007-01-29T18:35:57","date_gmt":"2007-01-29T17:35:57","guid":{"rendered":"http:\/\/www.galhano.com\/blog\/?p=253"},"modified":"2007-01-29T18:35:57","modified_gmt":"2007-01-29T17:35:57","slug":"kill-t-sql","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=253","title":{"rendered":"KILL (T-SQL)"},"content":{"rendered":"<p>Terminates a user process based on the system process ID (SPID). If the specified SPID has a lot of work to undo, the KILL may take some time to complete.<br \/>\nSyntax<\/p>\n<p>KILL {spid}<br \/>\nArguments<\/p>\n<p>spid<br \/>\nIs the SPID of the process to terminate. The SPID value is a unique integer (smallint) assigned to each user connection when the connection is made, but the assignment is not permanent.<\/p>\n<p>Remarks<\/p>\n<p>KILL is commonly used to terminate a process that is blocking other important processes with locks, or to terminate a process that is executing a query that is using necessary system resources. System processes and processes running an extended stored procedure cannot be terminated.<\/p>\n<p>Use KILL very carefully, especially when critical processes are running. You cannot kill your own process. Other processes not to kill are:<\/p>\n<p>* AWAITING COMMAND<br \/>\n* CHECKPOINT SLEEP<br \/>\n* LAZY WRITER<br \/>\n* LOCK MONITOR<br \/>\n* SELECT<br \/>\n* SIGNAL HANDLER<\/p>\n<p>Execute sp_who to get a report on valid SPID values. Use @@SPID to display the SPID value for the current session.<br \/>\nPermissions<\/p>\n<p>KILL permissions default to the members of the sysadmin fixed database role, and are not transferable.<br \/>\nExamples<\/p>\n<p>This example shows how to terminate SPID 10.<\/p>\n<p>KILL 10<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Terminates a user process based on the system process ID (SPID). If the specified SPID has a lot of work to undo, the KILL may take some time to complete. Syntax KILL {spid} Arguments spid Is the SPID of the process to terminate. The SPID value is a unique integer (smallint) assigned to each user [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,9],"tags":[],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-sql","category-sql-server","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=253"}],"version-history":[{"count":0,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}