June 4, 2013 at 6:57 am
Hi Team,
How can i know who dropped database in sql server...
Plz bit urgent.
June 4, 2013 at 7:01 am
the default trace has it,if not too much time has passed, since it only keeps the last 100 meg of changes
fastest way to get to it is to right click on the server in SSMS Object Explorer>>Reports>>Standard Reports>>Schema Changes History
Lowell
June 4, 2013 at 8:58 am
Thank u.
is there any query to get the same details...?
June 4, 2013 at 9:04 am
1. You can query sys.traces to make sure that default trace is running and to get path and file names.
2. select * from fn_trace_gettable (path_and_file, number_of_trace)
June 4, 2013 at 9:31 am
this is a query i like to use, to get teh path for me easily:
--SELECT * from sys.traces
declare @TraceIDToReview int
declare @path varchar(255)
SET @TraceIDToReview = 1 --this is the trace you want to review!
SELECT @path = path from sys.traces WHERE id = @TraceIDToReview
SELECT
TE.name As EventClassDescrip,
v.subclass_name As EventSubClassDescrip,
T.*
FROM ::fn_trace_gettable(@path, default) T
LEFT OUTER JOIN sys.trace_events TE ON T.EventClass = TE.trace_event_id
LEFT OUTER JOIN sys.trace_subclass_values V
ON T.EventClass = V.trace_event_id AND T.EventSubClass = V.subclass_value
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply