<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SQLDatabaseTalk</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/sqldatabasetalk/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/feed.xml</link>
    <description>This blog was created to post troubleshooting and supporting topics related to Windows Azure SQL Database also called SQL Database.  I plan to cross post to provide central resources.</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:25:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Description of SE_REPL Waits for Windows Azure SQL Database</title>
      <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/description-of-se_repl-waits-for-windows-azure-sql-database</link>
      <pubDate>Wed, 08 May 2013 18:04:03 GMT</pubDate>
      <dc:creator><![CDATA[Chris Skorlinski [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqldatabasetalk/2013/05/08/description-of-se_repl-waits-for-windows-azure-sql-database/</guid>
      <description><![CDATA[Description of SE_REPL Waits for Windows Azure SQL Database  Chris Skorlinski and John Sims...]]></description>
      <content:encoded><![CDATA[<p>Description of SE_REPL Waits for Windows Azure SQL Database</p>  <p>Chris Skorlinski and John Sims   <br />Microsoft SQL Server Escalation Services</p>  <p>If you've missed the announcement, we just published description of the Windows Azure SQL Database waits types including the SE_REPL waits.</p>  <p>sys.dm_db_wait_stats   <br /><a title="https://msdn.microsoft.com/en-us/library/dn170450.aspx" href="https://msdn.microsoft.com/en-us/library/dn170450.aspx">https://msdn.microsoft.com/en-us/library/dn170450.aspx</a></p>  <table cellspacing="3" cellpadding="0" width="791" border="1"><tbody>     <tr>       <td width="272">         <p>SE_REPL_CATCHUP_THROTTLE</p>       </td>        <td width="508">         <p>Occurs when the transaction is waiting for one of the database secondaries to make progress.</p>       </td>     </tr>      <tr>       <td width="272">         <p>SE_REPL_COMMIT_ACK</p>       </td>        <td width="508">         <p>Occurs when the transaction is waiting for quorum commit acknowledgement from secondary replicas.</p>       </td>     </tr>      <tr>       <td width="272">         <p>SE_REPL_COMMIT_TURN</p>       </td>        <td width="508">         <p>Occurs when the transaction is waiting for commit after receiving quorum commit acknowledgements.</p>       </td>     </tr>      <tr>       <td width="272">         <p>SE_REPL_ROLLBACK_ACK</p>       </td>        <td width="508">         <p>Occurs when the transaction is waiting for quorum rollback acknowledgement from secondary replicas.</p>       </td>     </tr>      <tr>       <td width="272">         <p>SE_REPL_SLOW_SECONDARY_THROTTLE</p>       </td>        <td width="508">         <p>Occurs when the thread is waiting for one of the database secondary replicas.</p>       </td>     </tr>   </tbody></table>]]></content:encoded>
    </item>
    <item>
      <title>Tracking down Deadlocks in SQL Database</title>
      <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/tracking-down-deadlocks-in-sql-database</link>
      <pubDate>Wed, 01 May 2013 06:25:24 GMT</pubDate>
      <dc:creator><![CDATA[Chris Skorlinski [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqldatabasetalk/2013/05/01/tracking-down-deadlocks-in-sql-database/</guid>
      <description><![CDATA[Tracking down Deadlocks in SQL Database  Chris Skorlinski   Microsoft SQL Server Escalation Services...]]></description>
      <content:encoded><![CDATA[<h1>Tracking down Deadlocks in SQL Database</h1>  <p>Chris Skorlinski   <br />Microsoft SQL Server Escalation Services</p>  <p>I want to share some tips for handling deadlocks in your SQL Database applications. You'll see the solutions for SQL Database are similar to on-premises SQL Server for which you'll well documented on web.&#160; I'll focus on parts unique to SQL Database.</p>  <p>&#160;</p>  <p>To me deadlocks are easier to understand if you create your own simple step-by-step deadlock, then see how the deadlock is shown in both SQL Server DMVs and via the SQL Database Management Portal.&#160; Let's get started.</p>  <h3>Generate a Deadlock</h3>  <p>I'm using the sample database AdventureWorks.&#160; I have 2 scripts, both doing update into the PersonPhone and Person table.&#160; Thread 1 update PersonPhone, then Person while Thread 2 updates Person, then PersonPhone.&#160; If these start at the same time, a classic deadlock.&#160; You have what I need to complete my work and I have what you need to complete your work.&#160; To make the queries less time-sensitive, I've added a WAITFOR DEALY.</p>  <p>Open a connection to SQL Database AdventureWorks and run script DeadLock Thread 1, then in a 2nd query window, execute Deadlock Thread 2.</p>  <pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Deadlock Thread 1</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BEGIN&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BEGIN</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=UPDATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">UPDATE</a> [Person].[PersonPhone]
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SET&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SET</a> PhoneNumber = '<span style="color: rgb(139, 0, 0);">999-555-1212</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> [BusinessEntityID] = 1
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WAITFOR&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WAITFOR</a> DELAY '<span style="color: rgb(139, 0, 0);">00:00:10</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=UPDATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">UPDATE</a> [Person].[Person]
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SET&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SET</a> [FirstName] = '<span style="color: rgb(139, 0, 0);">Chris</span>', [LastName] = '<span style="color: rgb(139, 0, 0);">Skorlinski</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> [BusinessEntityID] = 1
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ROLLBACK&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ROLLBACK</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a></pre></pre>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Deadlock Thread 2</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BEGIN&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BEGIN</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=UPDATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">UPDATE</a> [Person].[Person]
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SET&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SET</a> [FirstName] = '<span style="color: rgb(139, 0, 0);">Chris</span>', [LastName] = '<span style="color: rgb(139, 0, 0);">Skorlinski</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> [BusinessEntityID] = 1
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=UPDATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">UPDATE</a> [Person].[PersonPhone]
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SET&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SET</a> PhoneNumber = '<span style="color: rgb(139, 0, 0);">999-555-1212</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> [BusinessEntityID] = 1
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WAITFOR&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WAITFOR</a> DELAY '<span style="color: rgb(139, 0, 0);">00:00:10</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ROLLBACK&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ROLLBACK</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">/*
</span></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">(1 row(s) affected)
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">Msg 1205, Level 13, State 51, Line 10
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">Transaction (Process ID 773) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">*/
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre></pre>

<p>&#160;</p>

<h3>Deadlock Graph</h3>

<p>The application will receive Msg 1205 indicating that sessions\connections was &quot;victim&quot; and aborted while the other continued to execute until completion.&#160; To investigate further, you can retrieve historical deadlock details by querying sys.event_log DMVs.</p>

<p>For this DMV, you'll need to make a connection to the MASTER database for your server.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/1300.image_40A2FAF6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/1300.image_5F00_40A2FAF6.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/5773.image_thumb_5CF03D16.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/5773.image_5F00_thumb_5F00_5CF03D16.png" width="329" height="169" /></a></p>

<p>The sys.event_log DMV retrieves various connectivity related events for SQL Database.&#160; One of those are &quot;deadlock&quot; events.&#160; Run the query below to display our recent deadlock.&#160; The data display is retrieved from historical tables populated every few minutes.&#160; You may need to wait a bit before the actual deadlock is displayed.</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--sys.event_log</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Deadlock data displayed as XML in additonal_data</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> * <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.event_log
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> database_name <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=like&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">like</a> '<span style="color: rgb(139, 0, 0);">AdventureWorks2012</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=AND&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">AND</a> event_type = '<span style="color: rgb(139, 0, 0);">deadlock</span>' </pre></pre>

<p>&#160;</p>

<p>The deadlock is displayed as XML data under the additional_data column.&#160; Clicking in this column automatically opens the readable XML deadlock report.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/1300.image_2E2A8474.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/1300.image_5F00_2E2A8474.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/4604.image_thumb_3B90977A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/4604.image_5F00_thumb_5F00_3B90977A.png" width="541" height="53" /></a></p>

<p>&#160;</p>

<p>While a bit messy, looking at the output compared to our controlled example, we can better understand the structure of this report.&#160; The key sections are the &quot;victim-list&quot;, the &quot;process-list&quot; (winner) along with details on what resources were locked and what resources were being requested.&#160; </p>

<h5>Victim</h5>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/4113.image_7AEE4B0A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/4113.image_5F00_7AEE4B0A.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/1563.image_thumb_01352199.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/1563.image_5F00_thumb_5F00_01352199.png" width="363" height="212" /></a></p>

<h5>Winner</h5>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/4188.image_19588BF4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/4188.image_5F00_19588BF4.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/0572.image_thumb_71B20FC9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/0572.image_5F00_thumb_5F00_71B20FC9.png" width="436" height="200" /></a></p>

<h2>&#160;</h2>

<h2>SQL Database Portal</h2>

<p>You can also find deadlocks in your SQL Database portal under <strong>Databases</strong>, <strong>Administration</strong>, then <strong>Events</strong>.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/6747.image_70D9A9DF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/6747.image_5F00_70D9A9DF.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/3527.image_thumb_4213F13D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/3527.image_5F00_thumb_5F00_4213F13D.png" width="557" height="368" /></a></p>

<p>&#160;</p>

<p>&#160;</p>

<p>You show all events or as I've done in this report filter just for <strong>Deadlocks</strong>.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/2538.image_0824AE51.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/2538.image_5F00_0824AE51.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/4505.image_thumb_7C8EF111.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/4505.image_5F00_thumb_5F00_7C8EF111.png" width="391" height="167" /></a></p>

<p>&#160;</p>

<h3>Deadlock Details from SQL Database Portal</h3>

<p>I would recommend using SQL Server Management Studio to query sys.event_log table to retrieve the deadlock details.&#160; It's a bit more user friendly then SQL Database Portal.&#160; If you're using the portal, here are the steps.</p>

<p>In upper left corner, click your database, then select Master.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/0882.image_54E874E7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/0882.image_5F00_54E874E7.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/0550.image_thumb_0673E27D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/0550.image_5F00_thumb_5F00_0673E27D.png" width="244" height="97" /></a></p>

<p>Now click New Query and paste in the same sys.event_log DMV.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/8308.image_7ADE253D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/8308.image_5F00_7ADE253D.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/5265.image_thumb_7352B5D0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/5265.image_5F00_thumb_5F00_7352B5D0.png" width="244" height="102" /></a></p>

<p>Here is here it gets messy. Click the |&gt; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/0572.image_04C316A9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/0572.image_5F00_04C316A9.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/1452.image_thumb_396372E4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/1452.image_5F00_thumb_5F00_396372E4.png" width="56" height="35" /></a> to select the ROW displaying the deadlock.&#160; When selected, you'll see the |&gt; highlighted as shown below.&#160; Then CTRL-C to copy the row and paste into your favorite text editor like NotePad or TextPad.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/1462.image_720E1CF1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/1462.image_5F00_720E1CF1.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/0363.image_thumb_23998A87.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/0363.image_5F00_thumb_5F00_23998A87.png" width="840" height="129" /></a></p>

<p>&#160;</p>

<p>&#160;</p>

<p>This is one simple example to help your improve your comfort level with deadlocks.&#160; Here we clearly see the application was submitting 2 conflicting workload locking resources in different order leading to a deadlock.&#160; Your deadlocks can get more complicated as multiple connections with multiple queries.&#160; BING searching on deadlocks will provide great wealth of blog postings by SQL MVPs and white papers to help you resolve your deadlocks.</p>]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting Blocking in SQL Database–the why</title>
      <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/troubleshooting-blocking-in-sql-databasethe-why</link>
      <pubDate>Thu, 28 Mar 2013 06:46:44 GMT</pubDate>
      <dc:creator><![CDATA[Chris Skorlinski [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqldatabasetalk/2013/03/28/troubleshooting-blocking-in-sql-databasethe-why/</guid>
      <description><![CDATA[Chris Skorlinski    Microsoft SQL Server Escalation Services  In my last blog posting I explored SQL...]]></description>
      <content:encoded><![CDATA[<p>Chris Skorlinski    <br />Microsoft SQL Server Escalation Services</p>  <p>In my last blog posting I explored SQL DMVs used to find who is blocking queries from running.&#160; By Who, I mean other queries.&#160; We calls these &quot;head blockers&quot;.&#160; Our goal is to get those head blockers finished as quickly as possible to release resources for other queries.</p>  <p>For the &quot;the Why&quot; investigation we'll look at finding out what resources the head blocker is consuming, using, or waiting.&#160; We'll use some of the same AdventureWorks2012 sample database from previous blog posting.</p>  <p>Most often head blocker research falls into a few common categories.</p>  <ol>   <li>Head blocker is long running query\stored procedure</li>    <li>Head blocker running transactions within stored procedures and NOT releasing locks.</li>    <li>Head blocker waiting on system resources like CPU, Memory, or Disk</li> </ol>  <h4>&#160;</h4>  <h4>Long Running</h4>  <p>Queries running a long time will hold resources preventing other queries from selecting, updating, deleting, basically getting their work done.&#160; Examine the blocking query's &quot;logical reads&quot;.&#160; ( <a href="https://blogs.msdn.com/b/sqldatabasetalk/archive/2013/03/03/troubleshooting-blocking-in-sql-database-the-who.aspx">Troubleshooting Blocking in SQL Database - the who</a> ).&#160; Is head blocking reading more then 10,000 pages?&#160; more then 100,000?&#160; more then 1,000,000?&#160; As the number of pages processed by the query increases, more time will be spent retrieving rows from disk, reading through memory, consuming CPU, etc.&#160; Fast queries release resources quickly, less time to block.&#160; </p>  <p>Compare Logical Reads of head blocker to other queries running. Are they all about the same, all equally small, all equally bad?&#160; If head blocker has high reads, you'll want to examine the query plan and\or code logic to drop those logical reads.&#160; I'll give more examples in future blog postings on query plans.&#160; Searching BING for <strong>SQL MVP Query Plans </strong>you'll find great posts from SQL MVP community like Grant Fritchey, Kalen Delaney, Paul White and others on analyzing query plans</p>  <p>&#160;</p>  <h3>Waiting</h3>  <p>Okay, so the head blocker is NOT running through 1 million pages.&#160; Why is it holding pages?&#160; Like on premises SQL Server, running SQL Database we need to examine locks.&#160; Run the blocking example in my previous post, scroll through output and look at wait_type column.&#160; This begins investigating into WHY query is taking a long time.&#160; It is waiting on resources for 216 seconds! </p>  <pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Show Blocked Queries</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> * <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.dm_exec_requests
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> session_id &gt; 50 <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=and&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">and</a> session_id &lt;&gt; @@spid
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ORDER&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ORDER</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BY&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BY</a> blocking_session_id <span style="color: rgb(0, 128, 0);">-- blocking_sessions_id = 0 = not blocked</span></pre></pre>

<p>&#160;</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/4718.image_016E589F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/4718.image_5F00_016E589F.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/3644.image_thumb_211D3267.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/3644.image_5F00_thumb_5F00_211D3267.png" width="482" height="54" /></a></p>

<p>In this example its waiting on a lock.&#160; <strong>BING</strong> search will show you details on the different wait_types.&#160; </p>

<p>Locate the Head Blocker session_id</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/7851.image_0BBF7CFF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/7851.image_5F00_0BBF7CFF.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/3730.image_thumb_12728682.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/3730.image_5F00_thumb_5F00_12728682.png" width="179" height="72" /></a></p>

<p>&#160;</p>

<p>Next query <strong>sys.dm_tran_locks</strong> to see all the SQL system resources that are locked by this head blocker.&#160; Look through the output to get an understanding of what resources is the head blocker holding.&#160; One or many tables?&#160; One or many pages?</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Show LOCKS for blocking and blocked</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> request_session_id, request_status,resource_type, resource_description, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	resource_associated_entity_id, request_mode, request_status
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.dm_tran_locks 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> request_owner_type = N'<span style="color: rgb(139, 0, 0);">TRANSACTION</span>' 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=AND&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">AND</a> (request_session_id = 317 <span style="color: rgb(0, 128, 0);">-- Head Blocker</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=OR&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">OR</a> request_session_id = 878)  <span style="color: rgb(0, 128, 0);">-- Being Blocked</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ORDER&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ORDER</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BY&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BY</a> request_session_id
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=GO&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">GO</a></pre></pre>

<p>This query shows both resources GRANT and WAIT.&#160; How many rows are held by the GRANT? </p>

<p>Using the Partition_ID we can find out table name for the WAIT resource.</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">-- resource_associated_entity_id</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> object_name(object_id) '<span style="color: rgb(139, 0, 0);">Table Name</span>',
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	object_id, index_id, row_count, in_row_data_page_count, lob_reserved_page_count
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.dm_db_partition_stats
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> partition_id=72057597391601664</pre></pre>

<p>&#160;</p>

<p>Table Name&#160;&#160;&#160;&#160;&#160;&#160;&#160; object_id&#160;&#160; index_id&#160;&#160;&#160; row_count&#160;&#160;&#160; in_row_data_page_count lob_reserved_page_count 
  <br /> ----------------- ----------- ----------- ------------ ---------------------- ----------------------- 

  <br /> Person&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 997578592&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 19972&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2747&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 

  <br /></p>

<p><font size="1" face="Courier New"></font></p>

<p>Results here show waiting on the Person table, index #1.&#160; Now compare the query or Stored Procedure code for both the head blocker and the blocked to see where they overlap on the Person table.&#160; Maybe you can tune one query to run faster reducing the blocking time, or change the programming logic. to query then release the table.</p>

<p>&#160;</p>

<h3>Release Locks</h3>

<p>Stored procedures coded to release locks reduce the opportunity for blocking.&#160; I've seen many procedures where code written to hold the table locks longer then needed.&#160; For example:</p>

<p>Begin Transaction
  <br />SELECT a table 1

  <br />UPDATE a table 1

  <br />SELECT table 2

  <br />UPDATE table 2

  <br />Commit Transaction</p>

<p>If the 2nd SELECT runs longer then expected, the UPDATE LOCKS on the first table will not be released.&#160; Another user will be blocked waiting for Table 1 while problem is the long running SELECT on Table 2.&#160; Like my dog Roscoe, you'll be chasing your tail all day long.</p>

<p>Using No Locks not always the answer.&#160; Try coding stored procedures to be as lean as possible.&#160; Review the Isolation Levels, load data into TempDB or table variables.&#160; When developing, add <strong>WAITFOR DELAY '00:05:00'</strong> as last line of the SP then examine <strong>sys.dm_tran_locks</strong> to learn what is locked when the stored procedure ends.&#160; Any thing unexpected in the list?</p>

<h3>Waiting on System Resources</h3>

<p>If the head blocker is waiting on system resources you may need to scale out your SQL Database deployment, but first look at your overall work load.&#160; Do you have other queries consuming large resources?&#160; Who is the highest logical reader?&#160; One or two queries with high logical reads will load up buffer pool and tie up worker threads needed by other queries.&#160; A query updating a million rows which need to be committed on your failover secondary servers could be causing <strong>SE_REPL</strong> waits on other queries.</p>

<p>Start by polling <strong>sys.dm_exec_sessions</strong> and <strong>sys.dm_exec_requests</strong> over time looking at physical writes and logical reads.&#160; Here are couple queries to help.</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">-- Stuart Ozer, Connor Cunningham, Chris Skorlinski (revised)</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">-- View Currently Executing (dm_exec_requests)</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--		wait_type, wait_resource, statement_text, statement_plan</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--		execute user-defined statement_level_query_plan in the current DB.</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=select&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">select</a> pln.*, req.* <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=from&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">from</a> sys.dm_exec_requests <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=as&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">as</a> req
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=CROSS&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">CROSS</a> APPLY statement_level_query_plan(plan_handle) <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=as&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">as</a> pln
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=where&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">where</a> session_id &lt;&gt; @@spid <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=AND&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">AND</a> statement_text <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=like&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">like</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">'<span style="color: rgb(139, 0, 0);">%</span>' +
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">replace(
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=left&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">left</a>(
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=substring&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">substring</a>((<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=select&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">select</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=text&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">text</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=from&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">from</a> sys.dm_exec_sql_text(sql_handle)), 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            statement_start_offset/2, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            1+      <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=case&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">case</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=when&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">when</a> statement_end_offset = -1 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=then&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">then</a> LEN((<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=select&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">select</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=text&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">text</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=from&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">from</a> sys.dm_exec_sql_text(sql_handle))) - statement_start_offset/2
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=else&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">else</a> statement_end_offset/2 - statement_start_offset/2 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=end&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">end</a>) 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">        ,3000)
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">, '<span style="color: rgb(139, 0, 0);">[</span>','<span style="color: rgb(139, 0, 0);">[[]</span>') + '<span style="color: rgb(139, 0, 0);">%</span>'</pre></pre>

<p>&#160;</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Written by: Jonathan Kehayias SQLskills.com MVP</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Modified by: Chris Skorlinski, Microsoft SQL Server Escalation Services</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=select&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">select</a> dm_tran_locks.request_status,
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">       dm_tran_locks.request_session_id, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            dm_tran_locks.resource_database_id,
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            db_name(dm_tran_locks.resource_database_id) <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=as&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">as</a> dbname,
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=CASE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">CASE</a> 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                  <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHEN&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHEN</a> resource_type = '<span style="color: rgb(139, 0, 0);">object</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                        <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=THEN&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">THEN</a> object_name(dm_tran_locks.resource_associated_entity_id)
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                  <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ELSE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ELSE</a> object_name(partitions.object_id)
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=END&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">END</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=as&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">as</a> ObjectName,
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            partitions.index_id,
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            indexes.name <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=as&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">as</a> index_name,
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            dm_tran_locks.resource_type, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            dm_tran_locks.resource_description, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            dm_tran_locks.resource_associated_entity_id, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            dm_tran_locks.request_mode
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=from&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">from</a> sys.dm_tran_locks
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=left&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">left</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=join&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">join</a> sys.dm_db_partition_stats partitions <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=on&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">on</a> partitions.partition_id = dm_tran_locks.resource_associated_entity_id
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=join&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">join</a> sys.indexes <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=on&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">on</a> indexes.object_id = partitions.object_id <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=and&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">and</a> indexes.index_id = partitions.index_id
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=where&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">where</a> resource_associated_entity_id &gt; 0
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">  <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=and&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">and</a> resource_database_id = db_id()
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=order&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">order</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=by&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">by</a> request_session_id, resource_associated_entity_id</pre></pre>

<p>&#160;</p>

<p>You'll find more details on these in <a href="https://blogs.msdn.com/b/sqldatabasetalk/archive/2013/01/30/some-of-my-favorite-links.aspx">My Links</a> blog posting.</p>]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting Blocking in SQL Database - the who</title>
      <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/troubleshooting-blocking-in-sql-database-the-who</link>
      <pubDate>Sun, 03 Mar 2013 17:12:29 GMT</pubDate>
      <dc:creator><![CDATA[Chris Skorlinski [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqldatabasetalk/2013/03/03/troubleshooting-blocking-in-sql-database-the-who/</guid>
      <description><![CDATA[Chris Skorlinski   Microsoft SQL Server Escalation Services  In this blog I’ll walk through...]]></description>
      <content:encoded><![CDATA[<p>Chris Skorlinski   <br />Microsoft SQL Server Escalation Services</p>  <p>In this blog I’ll walk through troubleshooting blocking in SQL Database.&#160; As you’ll see, we’ll many of the same techniques used for on-premises SQL Servers with one exception, will not have use of SQL Server Profiler to capture server activity.&#160; While Profiler is often used, started with SQL Server 2005, the SQL DMVs provide the details about blocking.</p>  <p>For blocking, that is one user is holding resources need by one or more users, first step is to identify the “who”, that is head blocker and see what resources they hold.&#160; Next is understanding “why” they are holding resources followed by “what” option do we have to solve this problem.&#160; I’ll cover the “who” in this posting.</p>  <p>Start by making 2 connection to SQL Database. Execute the 2 scripts in each query.&#160; These examples are using the <a href="https://blogs.msdn.com/b/sqldatabasetalk/archive/2013/03/03/adventureworks-for-sql-database.aspx">AdventureWorks2012 sample</a> we installed earlier.</p>  <p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;">&#160;</p>  <pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Query 1: Start UPDATE blocking</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BEGIN&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BEGIN</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=UPDATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">UPDATE</a> [Person].[Person] <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WITH&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WITH</a> (<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=holdlock&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">holdlock</a>)
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SET&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SET</a> [FirstName] = '<span style="color: rgb(139, 0, 0);">Chris</span>', [LastName] = '<span style="color: rgb(139, 0, 0);">Skorlinski</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> [BusinessEntityID] = 1
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WAITFOR&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WAITFOR</a> DELAY '<span style="color: rgb(139, 0, 0);">00:04:00</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ROLLBACK&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ROLLBACK</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><p>&#160;</p><pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Query 2: Being Blocked</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BEGIN&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BEGIN</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=UPDATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">UPDATE</a> [Person].[Person]
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SET&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SET</a> [FirstName] = '<span style="color: rgb(139, 0, 0);">Chris</span>', [LastName] = '<span style="color: rgb(139, 0, 0);">Skorlinski</span>'
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">		<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> [BusinessEntityID] = 1
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ROLLBACK&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ROLLBACK</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TRANSACTION&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TRANSACTION</a>
</pre></pre></pre></pre>

<p>In this example Query 1 performs update using a &quot;holdlock&quot;, okay not most elegant, but it works, then goes into a 4 minute WAIT before rolling back the transactions.&#160; If you need more time while exploring the DMVs, just re-run these queries.</p>

<p>Now, in a 3rd query window connect again to same AdvenstureWorks2012 and executes queries below.</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> * 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.sysprocesses
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><p>SP_WHO</p><p>SP_WHO2</p><p>&#160;</p></pre></pre>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;">Sorry, those don't work, you can query dm_exec_session and dm_exec_requests to look at blocking details.</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Who's in my database</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> host_name, login_name, login_time,program_name,status,cpu_time, logical_reads
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.dm_exec_sessions
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> status &lt;&gt; '<span style="color: rgb(139, 0, 0);">sleeping</span>' <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=AND&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">AND</a> session_id &lt;&gt; @@spid
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Show work being performed, blocking, waits, open_transactions, query_hash, query_plan_hash</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> session_id,start_time,status,logical_reads,cpu_time,total_elapsed_time,
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	command,blocking_session_id,wait_type,wait_time,last_wait_type,wait_resource,connection_id, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">	sql_handle,plan_handle,query_hash,query_plan_hash
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.dm_exec_requests
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=WHERE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">WHERE</a> session_id &lt;&gt; @@spid
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=ORDER&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">ORDER</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BY&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BY</a> blocking_session_id <span style="color: rgb(0, 128, 0);">-- blocking_sessions_id = 0 = not blocked</span></pre></pre>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;">From dm_exec_requests look at the blocking_session_id column.&#160; Values = 0 indicate no blocking and often are the &quot;head blockers&quot;.&#160; For my example, you'll see query 1, &quot;running&quot; with command &quot;WAITFOR&quot;, and wait_type &quot;WAITFOR&quot;, normally you'll find more normal SQL commands such as an UPDATE, DELETE, INSERT.&#160; For our WAITER, you can see &quot;suspended&quot; with wait_type LCK_M_U, an update lock request.&#160; These guys aren't going anywhere real fast.</p>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/1541.image_6E4F7A09.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/1541.image_5F00_6E4F7A09.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/2211.image_thumb_3B1340A0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/2211.image_5F00_thumb_5F00_3B1340A0.png" width="742" height="66" /></a></p>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;">When troubleshooting your blocking, look closer at the logical_reads column, high values here (10K+) often indicate a busy query consuming too many resources and focus for tuning opportunities.&#160; I'll cover this more in another post. </p>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;">Identifying WHO also allows us to retrieve the sql_handle and plan_handle from dm_exec_requests.&#160; We can use built-in system functions to retrieve SQL statement and query plans for queries shown.</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--Retrive XML Query Plan for the UPDATE statement</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=SELECT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">SELECT</a> * <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=FROM&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">FROM</a> sys.dm_exec_query_plan(0x06001F00C5B3ED0EE0FE084D0400000001000000000000000000000000000000000000000000000000000000)
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"></pre></pre>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;">Results is the query_plan you can click-open in SQL Server Management Studio.&#160; Again, more on query plans later.</p>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/5751.image_7351B7B8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/5751.image_5F00_7351B7B8.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/5342.image_thumb_39CEA7C1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/5342.image_5F00_thumb_5F00_39CEA7C1.png" width="523" height="62" /></a></p>

<p class="MsoNormal" style="-ms-text-autospace:; mso-layout-grid-align: none;">&#160;</p>

<p>If you search the web, you'll find more example of using dm_exec_requests.&#160; Try some of these queries against our SQL Database AdventureWorks2012 example.&#160; Here is one I pull then modified from Stuart Ozer and Connor Cunningham (link in my &quot;favorite links&quot; posting I did earlier.</p>

<pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">-- Stuart Ozer, Connor Cunningham, Chris Skorlinski (revised)</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">-- View Currently Executing (dm_exec_requests)</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 128, 0);">--		wait_type, wait_resource, statement_text, statement_plan</span>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=select&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">select</a> pln.*, req.* <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=from&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">from</a> sys.dm_exec_requests <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=as&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">as</a> req
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=CROSS&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">CROSS</a> APPLY statement_level_query_plan(plan_handle) <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=as&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">as</a> pln
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=where&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">where</a> statement_text <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=like&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">like</a>
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">'<span style="color: rgb(139, 0, 0);">%</span>' +
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">replace(
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);"><a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=left&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">left</a>(
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=substring&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">substring</a>((<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=select&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">select</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=text&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">text</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=from&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">from</a> sys.dm_exec_sql_text(sql_handle)), 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            statement_start_offset/2, 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">            1+      <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=case&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">case</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=when&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">when</a> statement_end_offset = -1 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=then&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">then</a> LEN((<a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=select&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">select</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=text&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">text</a> <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=from&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">from</a> sys.dm_exec_sql_text(sql_handle))) - statement_start_offset/2
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=else&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">else</a> statement_end_offset/2 - statement_start_offset/2 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">                    <a style="color: rgb(0, 0, 255);" href="https://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=end&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">end</a>) 
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">        ,3000)
</pre><pre style="margin: 0em; width: 100%; font-family: consolas,&quot;Courier New&quot;,courier,monospace; font-size: 12px; background-color: rgb(255, 255, 255);">, '<span style="color: rgb(139, 0, 0);">[</span>','<span style="color: rgb(139, 0, 0);">[[]</span>') + '<span style="color: rgb(139, 0, 0);">%</span>'</pre></pre>

<p>&#160;</p>

<p>In my next posting I'll talk about WHY they may be blocking and WHAT are your next steps to prevent blocking.</p>]]></content:encoded>
    </item>
    <item>
      <title>AdventureWorks for SQL Database</title>
      <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/adventureworks-for-sql-database</link>
      <pubDate>Sun, 03 Mar 2013 16:36:36 GMT</pubDate>
      <dc:creator><![CDATA[Chris Skorlinski [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqldatabasetalk/2013/03/03/adventureworks-for-sql-database/</guid>
      <description><![CDATA[Chris Skorlinski   SQL Server Escalation Services  I’ll be posting SQL Database (Windows Azure SQL...]]></description>
      <content:encoded><![CDATA[<p>Chris Skorlinski   <br />SQL Server Escalation Services</p>  <p>I’ll be posting SQL Database (Windows Azure SQL Database) performance troubleshooting tips over the next few weeks.&#160; For most of these examples I’ll use the AdeventureWorks2012 sample database available for free download on CodePlex.</p>  <blockquote>   <p>AdventureWorks Community Samples Databases for Azure SQL Database     <br /><a href="https://msftdbprodsamples.codeplex.com/releases/view/37304">https://msftdbprodsamples.codeplex.com/releases/view/37304</a></p> </blockquote>  <p>Once you download, execute from a CMD prompt to run the install script against your SQL Database.&#160; You can also specify a “local” SQL Server if you want the same database installed both on-premises and in cloud.</p>  <blockquote>   <p>CreateAdventureWorksForSQLAzure.cmd {servername} {user} {pw}</p> </blockquote>  <p>Be sure to use the fully qualified SQL Database server name and administrative user as in my example below:</p>  <blockquote>   <p>CreateAdventureWorksForSQLAzure.cmd <span class="str">'abcxyz.database.windows.net'</span> <span class="str">'administrator_user'</span> <span class="str">'administrator_password'</span></p> </blockquote>  <p></p>  <p>Once the database is created you can connect using SQL Server Management Studio and browse similar to on-premise database.</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/3806.image_125B4A86.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/3806.image_5F00_125B4A86.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/4314.image_thumb_0A63A824.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/4314.image_5F00_thumb_5F00_0A63A824.png" width="319" height="232" /></a></p>  <p>Under the “Options &gt;&gt;” button you can switch the connection between the AdventureWorks2012 and MASTER databases.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/3005.image_377894F2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/3005.image_5F00_377894F2.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/57/97/metablogapi/8105.image_thumb_2861B618.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-57-97-metablogapi/8105.image_5F00_thumb_5F00_2861B618.png" width="314" height="160" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>SQL Database WAIT STATS</title>
      <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/sql-database-wait-stats</link>
      <pubDate>Thu, 31 Jan 2013 17:39:29 GMT</pubDate>
      <dc:creator><![CDATA[Chris Skorlinski [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqldatabasetalk/2013/01/31/sql-database-wait-stats/</guid>
      <description><![CDATA[--SQL Database WAIT STATS--New for SQL Database (Windows Azure SQL Database) are database level WAIT...]]></description>
      <content:encoded><![CDATA[<p>--SQL Database WAIT STATS<br />--New for SQL Database (Windows Azure SQL Database) are database level WAIT STATS.&nbsp; These are executed against the application database, not the MASTER database.<br />--Retrieve cached performance WAIT stats by database<br />--dm_db_wait_stats</p>
<p>&nbsp;</p>
<p>SELECT * FROM sys.dm_db_wait_stats<br />ORDER BY wait_time_ms desc</p>
<p>&nbsp;&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: x-small;">wait_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; waiting_tasks_count&nbsp; wait_time_ms&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; max_wait_time_ms&nbsp;&nbsp;&nbsp;&nbsp; signal_wait_time_ms<br /></span><span style="font-family: courier new,courier; font-size: x-small;">--------------------------------------------- -------------------- -------------------- -------------------- --------------------<br /></span><span style="font-family: courier new,courier; font-size: x-small;">LCK_M_U&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 640004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 225320&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br /></span><span style="font-family: courier new,courier; font-size: x-small;">ASYNC_NETWORK_IO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12508&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 62532&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 192&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 345<br /></span><span style="font-family: courier new,courier; font-size: x-small;">PAGEIOLATCH_SH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10999&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1362&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 69<br /></span><span style="font-family: courier new,courier; font-size: x-small;">SE_REPL_COMMIT_ACK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7551&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 244&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 372<br /></span><span style="font-family: courier new,courier; font-size: x-small;">SE_REPL_SLOW_SECONDARY_THROTTLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7356&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1178&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10<br /></span><span style="font-family: courier new,courier; font-size: x-small;">SOS_SCHEDULER_YIELD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8915&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1799&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1778</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><span style="font-size: small;">Chris Skorlinski<br />Microsoft SQL Server Escalation Services <br /> </span></strong><strong></strong></p>
<p><span style="font-family: Calibri; font-size: small;"></span></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="3">
<p><strong></strong>&nbsp;</p>
</td>
</tr>
<tr>
<td width="278">
<p>&nbsp;</p>
</td>
<td width="278">
<p>&nbsp;</p>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<p><em></em>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Some of my favorite links</title>
      <link>https://docs.microsoft.com/archive/blogs/sqldatabasetalk/some-of-my-favorite-links</link>
      <pubDate>Wed, 30 Jan 2013 11:08:48 GMT</pubDate>
      <dc:creator><![CDATA[Chris Skorlinski [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqldatabasetalk/2013/01/30/some-of-my-favorite-links/</guid>
      <description><![CDATA[Chris Skorlinski    SQL Server Escalation Services         There is some great learning...]]></description>
      <content:encoded><![CDATA[<p>Chris Skorlinski    <br />SQL Server Escalation Services     <br />    <br />There is some great learning opportunities for Windows Azure SQL Database.&#160; I decided to collect some of my favorites and includes them on my LINKS posting.</p>  <h3>Tools</h3>  <p><a href="https://blogs.msdn.com/b/psssql/archive/2011/04/25/css-sql-azure-diagnostics-tool-released.aspx">CSS SQL Azure Diagnostics tool released</a>     <br />--Web Portal tool to display historical query performance stats from SQL Database</p>  <p><a href="https://msdn.microsoft.com/en-us/library/windowsazure/ee621784.aspx">Tools and Utilities Support (Windows Azure SQL Database)</a></p>  <p><a href="https://sqlcat.com/sqlcat/b/msdnmirror/archive/2010/07/30/loading-data-to-sql-azure-the-fast-way.aspx">SQL Azure CAT team article on loading data into SQL Azure</a>    <br />-- Other AzureCAT content can be found on:&#160; <a href="https://windowsazurecat.com/index.php">Windows Azure Customer Advisory Team</a></p>  <p><a href="https://www.microsoft.com/en-us/download/details.aspx?id=23217">Sync Framework Programming Tools to move data between On-Premise SQL Server and cloud SQL Database</a></p>  <h3>Blog Postings</h3>  <p><a href="https://blogs.msdn.com/b/windowsazure/">Main Microsoft Windows Azure blog along with SQL Database posts</a></p>  <p><a href="https://social.technet.microsoft.com/wiki/contents/articles/1657.gaining-performance-insight-into-windows-azure-sql-database.aspx">Gaining Performance Insight into Windows Azure SQL Database</a>     <br />--Wayne Walter Berry posting on displaying SQL Database Query plans</p>  <p><a href="https://blogs.msdn.com/b/sqlazure/archive/2010/07/27/10043069.aspx">Improving Your I/O Performance</a>     <br />--Wayne Walter Berry posing on Query plans and covering indexes</p>  <p><a href="https://blogs.msdn.com/b/wayneb/archive/2012/11/02/introducing-sys-database-connection-stats-for-troubleshooting-windows-azure-sql-database.aspx">Introducing sys.database_connection_stats for Troubleshooting Windows Azure SQL Database</a>     <br />--Yes, another Wayne favorite of mine.</p>  <p><a href="https://thomaslarock.com/2012/04/march-madness-sql-azure-wait-events/">SQL Database Wait Events</a>     <br />--I follow all of Thomas Larock BLOG postings.&#160; He's writing style is easy to read and informative.</p>  <p><a href="https://blogs.msdn.com/b/sqldatabasetalk/">New BLOG on troubleshooting and best practices for SQL Database.&#160; This one has great potential.</a></p>  <h3>MSDN White Papers</h3>  <p><a href="https://msdn.microsoft.com/en-us/library/windowsazure/jj879332.aspx">Windows Azure SQL Database and SQL Server -- Performance and Scalability Compared and Contrasted</a>     <br />--On my “must read” list of Conor Cunningham papers.</p>  <p><a href="https://social.technet.microsoft.com/wiki/contents/articles/1541.windows-azure-sql-database-connection-management.aspx">Windows Azure SQL Database Connection Management</a>     <br />--Another “must read” by Selcin Turkarslan and Srini Acharya.&#160; This coverings throttling and reconnects is great detail.</p>  <p><a href="https://msdn.microsoft.com/en-us/library/windowsazure/jj717232.aspx">Best Practices for the Design of Large-Scale Services on Windows Azure Cloud Services</a>    <br />--Another great article providing best practice insight into scaling out Windows Azure and SQL Database.&#160; If you’re just using SQL Database, skip down to the SQL Database section, it alone is a great technical overview of SQL Database</p>]]></content:encoded>
    </item>
  </channel>
</rss>