Want the latest SQL query for sessions on your server? Join sys.dm_exec_connections with sys.dm_exec_sql_text using most_recent_sql_handle.
SQL SERVER – Find Max Worker Count using DMV – 32 Bit and 64 Bit
Does doubling the CPUs double the worker threads? No. Use sys.dm_os_sys_info to find Max Worker Count, and see the formula for 32 bit and 64 bit.
Watching the tempdb Version Store
Watch the tempdb version store with per-database space DMVs, find transactions that delay cleanup, and plan capacity from trends.
SQL SERVER – DMV Error: FIX: Error: Msg 297, Level 16 The user does not have permission to perform this action
Msg 297 appears when a user runs a DMV without the right permission. Ask your admin to GRANT VIEW SERVER STATE, and the DMV runs without errors.
Practicing Azure SQL at Low Cost
Practicing Azure SQL can stay inexpensive with current free offers, serverless auto-pause, budget alerts, and deliberate resource cleanup.
Following a Blocking Chain to the Head Blocker
Follow SQL Server blocking_session_id through a blocking chain, identify the head blocker, and choose a safe ending for the wait.
SQL SERVER – Recently Executed T-SQL Query
fn_get_sql() and DBCC INPUTBUFFER will be deprecated. Use sys.dm_exec_query_stats and sys.dm_exec_sql_text to see each recently executed T-SQL query.






