Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to get one year old query from plan cache

SELECT TOP 10
t.TEXT QueryName,
s.execution_count AS ExecutionCount,
s.max_elapsed_time AS MaxElapsedTime,
ISNULL(s.total_elapsed_time / 1000 / NULLIF(s.execution_count, 0), 0) AS AvgElapsedTime,
s.creation_time,
ISNULL(s.execution_count / 1000 / NULLIF(DATEDIFF(s, s.creation_time, GETDATE()), 0), 0) AS FrequencyPerSec
,query_plan
FROM sys.dm_exec_query_stats s
CROSS APPLY sys.dm_exec_query_plan( s.plan_handle ) u
CROSS APPLY sys.dm_exec_sql_text( s.plan_handle ) t
ORDER BY creation_time
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle sql winter time change 
Sql :: cube oracle 
Sql :: trncate table with relationships 
Sql :: sql tablo hangi sp de 
Sql :: sql update from two different database 
Sql :: vbscript clean up ADODB.Recordset 
Sql :: deduplicate delimited string bigquery 
Sql :: where in clause tsql 
Sql :: sql data type of query 
Sql :: TSQL Find csv file in folder 
Sql :: mysql use password error 
Sql :: basic structure of sql expression having clause 
Sql :: copy data from cell to cell mysql 
Sql :: One table with another 
Sql :: connect colab with Microsoft sql server 
Sql :: plsql check how much space all databases are consuming 
Sql :: how to count with except in psql 
Sql :: providername system.data. mysql 
Sql :: opensuse start MySQL 
Sql :: Patch Applied to the Oracle Database 
Sql :: enable mysql remote connection to two specific ip address 
Sql :: database create table date of birth data type 
Sql :: a query to determine the version of a database 
Sql :: how to change null display in psql 
Sql :: Update All tables COLLATE DATABASE_DEFAULT 
Sql :: stratified sampling sql 
Sql :: sqlite display data in separated columns 
Sql :: mysql et python 
Sql :: sql server agent not running 
Sql :: sql cheetsheet 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =