{"id":513,"date":"2008-10-27T17:20:18","date_gmt":"2008-10-27T22:20:18","guid":{"rendered":"http:\/\/www.juixe.com\/techknow\/index.php\/2008\/10\/27\/sql-server-who-lock\/"},"modified":"2008-10-27T17:20:18","modified_gmt":"2008-10-27T22:20:18","slug":"sql-server-who-lock","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2008\/10\/27\/sql-server-who-lock\/","title":{"rendered":"SQL Server Who Lock"},"content":{"rendered":"<p>When working with <b>SQL Server<\/b>, two procedures that I use from time to time is sp_who and sp_lock.  The sp_who procedure provides information as to which loginame, hostname, dbname are for current users.  Usually I am just interested the activity on a given user, which you can use the following SQL command.<\/p>\n<pre>\nsp_who @loginame = 'sa'\n<\/pre>\n<p>The sp_lock procedure reports on which sessions ids are locked in the database.  There are different level of locks such as database, table, and data locks.<\/p>\n<p>Technorati Tags: <a href=\"http:\/\/technorati.com\/tag\/sql\" rel=\"tag\">sql<\/a>, <a href=\"http:\/\/technorati.com\/tag\/server\" rel=\"tag\"> server<\/a>, <a href=\"http:\/\/technorati.com\/tag\/db\" rel=\"tag\"> db<\/a>, <a href=\"http:\/\/technorati.com\/tag\/database\" rel=\"tag\"> database<\/a>, <a href=\"http:\/\/technorati.com\/tag\/sp_lock\" rel=\"tag\"> sp_lock<\/a>, <a href=\"http:\/\/technorati.com\/tag\/sp_who\" rel=\"tag\"> sp_who<\/a>, <a href=\"http:\/\/technorati.com\/tag\/procedure\" rel=\"tag\"> procedure<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with SQL Server, two procedures that I use from time to time is sp_who and sp_lock. The sp_who procedure provides information as to which loginame, hostname, dbname are for current users. Usually I am just interested the activity on a given user, which you can use the following SQL command. sp_who @loginame = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[23,3,4],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-8h","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/513"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=513"}],"version-history":[{"count":0,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/513\/revisions"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=513"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}