TSQL Circle Live

Blog Post

Find Most executed queries

SELECT TOP 50
QueryState.execution_count
,OBJECT_NAME(objectid)
,query_text = SUBSTRING(
qt.text,
QueryState.statement_start_offset/2,
(CASE WHEN QueryState.statement_end_offset = -1
THEN len(convert(nvarchar(max), qt.text)) * 2
ELSE QueryState.statement_end_offset
END - QueryState.statement_start_offset)/2)
,qt.dbid
,dbname = db_name(qt.dbid)
,qt.objectid
FROM sys.dm_exec_query_stats QueryState
CROSS APPLY sys.dm_exec_sql_text(QueryState.sql_handle) as qt
ORDER BY...

2018-09-18

2,054 reads

Blog Post

Get all queries running against any specific table

/*Get list of all queries hitting any specific tables*/SELECT DISTINCT TOP 100ProcedureName = OBJECT_SCHEMA_NAME(sqlTxt.objectid) + '.' + OBJECT_NAME(sqlTxt.objectid),SQLStatement = SUBSTRING(sqlTxt.Text,(QueryState.statement_start_offset/2)+1,CASE QueryState.statement_end_offsetWHEN -1 THEN DATALENGTH(sqlTxt.text)ELSE QueryState.statement_end_offsetEND...

2018-09-18

3,734 reads

Blogs

TempDB Performance Tuning in SQL Server 2022 vs 2016 vs 2019

By

📘 What Is TempDB and Why It Matters TempDB is a shared system database in SQL...

Optimize Azure Fabric Pipelines with This Key Spark Setting

By

Boost Your Azure Fabric Pipelines: Don’t Overlook This Crucial Spark Setting Are your Azure...

SQL Server Post-Install Configurations

By

The SQL Server installer has gotten better: tempdb configuration, MAXDOP, and even max memory...

Read the latest Blogs

Forums

How a Legacy Logic Choked SQL Server in a 30-Year-Old Factory

By Chandan Shukla

Comments posted to this topic are about the item How a Legacy Logic Choked...

AGs: Linked Servers and Kerberos

By lanky_doodle

Hey, When connecting SSMS using the AG name, it never works. Creating the linked...

Improve Focus and Alertness with Waklert 150mg

By Harrisjake

Waklert 150 mg is a potent nootropic that promotes mental clarity, attention, and alertness....

Visit the forum

Question of the Day

Capacity Planning for an Existing SQL Server Workload?

You're tasked with planning capacity for a new SQL Server database workload. Which of the following is the most accurate way to determine how much CPU, memory, and I/O throughput your workload requires?  What single or multiple tools would you use to answer the questions around resource needs?

See possible answers