2015년 12월 18일 금요일

MSSQL 쿼리 기록 조회...

어떤 쉐리가 데이터 지웠는데.. 안했다고 잡아 때는 중... 잡아서 고문해주마!!!

으흐흐흐흐흐흐흐흐흐!!!!





SELECT TOP 100 creation_time, 
               last_execution_time, 
               total_clr_time, 
               total_clr_time / execution_count         AS [Avg CLR Time], 
               last_clr_time, 
               execution_count, 
               Substring(st.text, ( qs.statement_start_offset / 2 ) + 1, 
               ( 
               ( CASE statement_end_offset 
               WHEN -1 THEN Datalength(st.text) 
               ELSE qs.statement_end_offset 
                                                                             END 
                 - 
                 qs.statement_start_offset ) / 2 ) + 1) AS statement_text 
FROM   sys.dm_exec_query_stats AS qs 
       CROSS apply sys.Dm_exec_sql_text(qs.sql_handle) AS st 
ORDER  BY total_clr_time / execution_count DESC; 

댓글 없음:

댓글 쓰기

[낯선] 2025.10.11 인천 노크 공연

  Live at @인천노크 on 2025.10.11 Set List 1. 디어클라우드 - 얼음요새 Covered by 낯선 2. 낯선 - Misty Dive 3. 솔루션스 - 청춘 Covered by 낯선 4. 낯선 - Not Your Fault...