TSQL Circle Live

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

243 reads

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

154 reads

Blogs

What you need to know About Azure SQL backup

By

Most of DBA are coming from On-premise Database Servers they know very well How...

Social: Respecting Names

By

This is a non-technical post, and my opinion. If you don’t want to read...

Proud to present at this year’s VMworld 2020 conference

By

I’m thrilled to support and participate in this year’s VMworld 2020 conference, which is...

Read the latest Blogs

Forums

sql server installation in azure VM

By abdalah.mehdoini

Good morning all for an sql installation in an AZURE VM machine the installation...

slow query

By thenewbee

Hi All, I have some issue with a slow running query and im quite...

How to be an MVP

By Kathi Kellenberger

Comments posted to this topic are about the item How to be an MVP

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

BDC Storage

See possible answers