7

I am using SQL Server 2008 and noticed that an important stored procedure was missing.

How do I find out when and by whom a stored procedure was dropped.

tom
  • 1,822
  • 4
  • 25
  • 43

1 Answers1

7

First you get location of admintrace:

select * from fn_trace_getinfo(NULL)
where property=2
and traceid in (1,2,3,4,5) --sometime several logs available

and then you check all details:

select DatabaseName,ObjectName,LoginName,StartTime,* 
from fn_trace_gettable('c:\path_to_log\MSSQL\Log\log_2.trc', -1)
where EventClass = 47  --Object:Deleted
revoua
  • 2,044
  • 1
  • 21
  • 28