소리소문 없이... 사랑도 명예도 이름도 남김 없이...
DexCore.net

DataBase/SQL Server

SP 쿼리 실행 이력 조회 쿼리

탑~! 2026. 4. 30. 09:53

SELECT Db_name(st.dbid)                      DBName,
       Object_schema_name(objectid, st.dbid) SchemaName,
       Object_name(objectid, st.dbid)        SPName,
       qs.total_elapsed_time,
       creation_time,
       last_execution_time,
       text
FROM   sys.dm_exec_query_stats qs
       CROSS apply sys.Dm_exec_sql_text(qs.plan_handle)st
       JOIN sys.dm_exec_cached_plans cp
         ON qs.plan_handle = cp.plan_handle

728x90
반응형

'DataBase > SQL Server' 카테고리의 다른 글

DBCC CHECKIDENT란 무엇일까?  (0) 2026.04.30
프로시저 전체 삭제 쿼리  (0) 2026.04.30
SP 마지막 호출 시간 조회  (0) 2026.04.30
DB에 접속한 사용자 수 조회  (0) 2026.04.30
DB 접속자 정보 조회  (0) 2026.04.30