Arun Kumar

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

141 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

144 reads

Blogs

The Data platform has evolved – so too must the DBA.

By

This blog post is around the changing landscape of both SQL Server and the...

What does the Machine Learning process look like?

By

This is the second article in the Machine Learning area. I have explained a...

Azure Cosmos DB: real-time data movement using Change Feed and Azure Functions

By

In this article, we will focus on creating a data pipeline to ETL (Extract,...

Read the latest Blogs

Forums

Container Ports

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Container Ports

Receiving timeout errors on SQL2014

By Dhruva_51

Similar to the one mentioned in the below article. We are sql server build...

Continue SQL Server transactional replication with AWS DMS

By tttcoding

Hello, I have a task for which I wasn't able to find much information...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers