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.
Right click SQL Server Instance and Select Reports -> Standard Reports -> Schema Changes History as shown in the below snippet. 3. This will open up Scheme Changes History report which will have the details about who deleted the SQL Server Database along with the timestamp when the database was deleted.
You can recover deleted stored procedure in SQL Server through two methods- by using Backup and Restore wizard of SQL Server Management Studio and by using enterprise software.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With