Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Check top 100 DB Queries performed

Author  Topic 

velnias2010
Posting Yak Master

125 Posts

Posted - 2010-06-29 : 09:30:24
I.e this is possible I want to check if certain delete queries where used on my database.

Thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-06-29 : 10:09:45
Try this

SELECT TOP 100
last_execution_time ,
(SELECT SUBSTRING(text,statement_start_offset/2,(CASE WHEN statement_end_offset = -1 then LEN(CONVERT(nvarchar(max), text)) * 2 ELSE statement_end_offset end -statement_start_offset)/2) FROM sys.dm_exec_sql_text(sql_handle)) AS query_text
FROM sys.dm_exec_query_stats
ORDER BY last_execution_time DESC


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -