{"id":71,"date":"2011-11-08T01:49:49","date_gmt":"2011-11-08T01:49:49","guid":{"rendered":"http:\/\/www.sqlfreelancer.com\/blog\/?p=71"},"modified":"2014-03-01T02:47:41","modified_gmt":"2014-03-01T02:47:41","slug":"sp_who","status":"publish","type":"post","link":"https:\/\/www.sqlfreelancer.com\/blog\/sp_who\/","title":{"rendered":"sp_who"},"content":{"rendered":"<p>There are numerous ways you can view blocking information but I\u2019ll share the most popular in sp_who and sp_who2.<\/p>\n<p>Like their name implies sp_who and sp_who2 give information about \u201cwho\u201d is in your SQL Server as well as other useful information including processes and blocking info.<\/p>\n<p>Below is an example of sp_who running against a SQL Server:<\/p>\n<p><a href=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2014\/03\/SQL-Server-sp_who.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-72\" alt=\"SQL Freelancer SQL Server sp_who\" src=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2014\/03\/SQL-Server-sp_who.png\" width=\"561\" height=\"454\" srcset=\"https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2014\/03\/SQL-Server-sp_who.png 561w, https:\/\/www.sqlfreelancer.com\/blog\/wp-content\/uploads\/2014\/03\/SQL-Server-sp_who-300x242.png 300w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><\/a><\/p>\n<p>As you can see, sp_who will return SPID, status, loginname, blk, dbname, etc.<\/p>\n<p>spid \u2013 The system process ID.<br \/>\necid \u2013 The execution context ID of a given thread associated with a specific SPID.<br \/>\nstatus \u2013 The process status.<br \/>\nloginame \u2013 The login name associated with the particular process.<br \/>\nhostname \u2013 The host or computer name for each process.<br \/>\nblk \u2013 The system process ID for the blocking process, if one exists. Otherwise, this column is zero.<\/p>\n<p>When a transaction associated with a given SPID is blocked by an orphan distributed transaction, this column will return a \u2018-2\u2032 for the blocking orphan transaction.<br \/>\ndbname \u2013 The database used by the process.<br \/>\ncmd \u2013 The SQL Server command (Transact-SQL statement, SQL Server internal engine process, and so on) executing for the process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are numerous ways you can view blocking information but I\u2019ll share the most popular in sp_who and sp_who2. Like their name implies sp_who and sp_who2 give information about \u201cwho\u201d is in your SQL Server as well as other useful information including processes and blocking info. Below is an example of sp_who running against a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[28,27,105,39],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-monitoring","tag-blocking","tag-locks","tag-monitoring","tag-ssms"],"_links":{"self":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":2,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":89,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions\/89"}],"wp:attachment":[{"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlfreelancer.com\/blog\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}