“How many DMV and DVF are there in SQL Server 2008?” – this question was asked to me in one of the recent SQL Server Training.
SQL SERVER – Finding Expensive Cached Query Statements with DMVs
Finding the Most Expensive Queries starts with choosing a resource measure. I use cached statistics as an investigation aid.
SQL SERVER – Get Latest SQL Query for Sessions – DMV
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.
When Are Statistics Updated? What Triggers an Automatic Update
Statistics updated automatically need two things: enough changed rows, and a query that uses the statistic. This post explains the old 500 plus 20 percent rule and the newer square root threshold, then shows a million-row demo where last_updated changes only after a query compiles. It also covers FULLSCAN, asynchronous updates and when to update by hand.
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.






