Link to home
Start Free TrialLog in
Avatar of catwalk
catwalk

asked on

Who deleted database

How can I find out who deleted a database?  I know it is not best practice to allow multiple users  sysadmin access or dbo access.  

I have tried the code below and it did not tell me.

Any other suggestions?

DECLARE @path varchar(256) 
 
SELECT @path = path 
FROM sys.traces 
where id = 1 
 
SELECT TextData, HostName, ApplicationName, LoginName, StartTime, DatabaseName 
FROM fn_trace_gettable(@path, 1) 
where TextData is not null 
order by startTime desc

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mikeewalton
mikeewalton
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial