Who dropped my table?

How can you inspect the nitwit who dropped a table on your database when no tracing is available and even the default trace is turned of… That’s no rocket science, if you take action right away:

##############################################
##fn_dblog: Read from the transaction log ##
## Mk 05082014 ##
##############################################

USE MyDatabBase
GO
SELECT
Operation,
[Transaction Id],
[Transaction SID],
[Transaction Name],
[Begin Time],
[SPID],
Description
FROM fn_dblog (NULL, NULL)
WHERE [Transaction Name] = 'DROPOBJ'
GO

##############################################
## Whodunnit ##
##############################################
SELECT SUSER_SNAME(Ox01)

Good luck for both of you!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: