Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server last executed query

SELECT deqs.last_execution_time AS [Time], dest.text AS [Query], dest.*
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
WHERE dest.dbid = DB_ID('msdb')
ORDER BY deqs.last_execution_time DESC

SELECT dest.TEXT AS [Query],
deqs.execution_count [Count],
deqs.last_execution_time AS [Time]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
ORDER BY deqs.last_execution_time DESC
Comment

PREVIOUS NEXT
Code Example
Sql :: select users 
Sql :: run postgres with docker 
Sql :: search stored procedures by name 
Sql :: postgres delete from where date is greater than specific date 
Sql :: convert_tz mysql 
Sql :: create table oracle 
Sql :: VERIFY INDEXES IN SQL ORACLE 
Sql :: rename column postgres 
Sql :: delete first row in sql 
Sql :: alter table engine mysql 
Sql :: add sequence postgres 
Sql :: mysql import gz 
Sql :: mysql import gzip db 
Sql :: status mysql 
Sql :: mysql concat two columns laravel eloquent 
Sql :: oracle compile whole schema 
Sql :: postgres connection string 
Sql :: get count by weekly pivot table sql server 
Sql :: sql how to replace full stop 
Sql :: SELECT User,Host FROM mysql.user; 
Sql :: having count greater than 1 mysql 
Sql :: how to check database size mysql 
Sql :: dynamics 365 x++ aggregate querybuilddatasource 
Sql :: convert float to int sql 
Sql :: oracle export trigger ddl 
Sql :: role does not exist psql 
Sql :: oracle sql truncate table 
Sql :: mysql extract month 
Sql :: drop table if exists oracle 
Sql :: how to get table structure in sql server 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =