Determine which user deleted a SQL Server database?
database, sql-server, sql-server-2005
Solution
If there has been little or no activity since the deletion, then the out-of-the-box trace may be of help. Try running:
DECLARE @path varchar(256)
SELECT @path = path
FROM sys.traces
where id = 1
SELECT *
FROM fn_trace_gettable(@path, 1)
[In addition to the out-of-the-box trace, there is also the less well-known 'black box' trace, which is useful for diagnosing intermittent server crashes. This post, SQL Server’s Built-in Traces, shows you how to configure it.]
Problem
I have a SQL Server 2005 database that has been deleted, and I need to discover who deleted it. Is there a way of obtaining this user name? Thanks, MagicAndi.