DataBase/SQL Server

SP 마지막 호출 시간 조회

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


SELECT NAME,
       lastdate
FROM   (SELECT b.NAME,
               Max(a.last_execution_time) AS lastdate
        FROM   sys.dm_exec_procedure_stats a
               INNER JOIN sys.objects b
                       ON a.object_id = b.object_id
        WHERE  Db_name(a.database_id) = '데이터베이스이름'
        GROUP  BY b.NAME)z
ORDER  BY lastdate DESC

728x90
반응형