Diagnosing: The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time

Have you ever had the joy of receiving this error message? The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running […]

Read More

Have you ever wondered what SQL generated that FETCH or FETCH API_CURSOR statement?

Have you ever seen a FETCH statement show up when monitoring via activity monitor, sysprocesses, dm_exec_requests, or name your monitoring tool of choice?  These surface when a process is programatically fetching through a cursor.  Most of the time the fetch statement isn’t of interest when performance tuning.  Instead it is of more use to see […]

Read More

What is a query_hash or query_plan_hash and why is it useful?

If you have ever queried sys.dm_exec_requests or sys.dm_exec_query_stats you may have noticed the query_hash and query_plan_hash columns.  If you’re familiar with a sql_handle and plan_handle the query_hash and query_plan_hash should be easy to understand.  A query_hash is a computed value that points to a query irrespective of literal values.  Similarly a query_plan_hash is a computed […]

Read More