|
how to find which user dropped a table in a database.
(comments are locked)
|
|
In SSMS you can try right-clicking on the dB and navigating through Reports -> Standard Reports -> Schema Changes History.
Note that this is based on the default trace so your mileage may vary. +1 for a good option and with pictures. We ought to use them more.
Oct 13 '10 at 10:18 AM
Fatherjack ♦♦
Pictures? You can put pictures in this thing? Who knew! ;-)
Oct 13 '10 at 12:35 PM
ThomasRushton ♦
@Fatherjack, definitely. Pictures are good. @Blackhawk, I know you said it in your answer, but it's worth really highlighting that this depends on the default trace...
Oct 13 '10 at 12:57 PM
TimothyAWiseman
thank you very much.....
Oct 14 '10 at 12:57 AM
Murali
There is an impact, because actions are being "watched" and audited in the trace file. The impact is minimal though and the default trace will be running unless you explicitly turned it off. You can safely leave this turned on, unless you are experiencing problems (bottlenecks on the drive where the trace is located)
Oct 14 '10 at 01:31 AM
WilliamD
(comments are locked)
|
|
In addition to all the answers to this question I want to share a script from a collegue of mine. This script is using the default trace to list who changed what. The complete blog post can be found at http://www.sqlservice.se/?s=default+trace @Hakan - thats a great script, thanks for including it. I didnt realise Feodor is a colleague of yours - he did a nice blog about tweaking some code I wrote to use TypePerf to collect performance stats. Your employers are very lucky to have you two working there. My blog - http://www.simple-talk.com/community/blogs/jonathanallen/archive/2010/12/20/96284.aspx
Feb 02 '11 at 01:58 AM
Fatherjack ♦♦
+1 @Fatherjack, thanks for sharing those links
Feb 02 '11 at 02:04 AM
Cyborg
@Cyborg - no problem, its a bit off-topic but as I had mentioned them I thought it easier to include them than come back when someone asks for the details!
Feb 02 '11 at 03:58 AM
Fatherjack ♦♦
@fatherjack, it was very resourceful!
Feb 02 '11 at 04:17 AM
Cyborg
Comment to FatherJacks comment: Yes, we at SQL Service are very lucky to have Håkan and Feodor with us :-) We even have a few more of the same kind. /Steinar Andersen, CEO SQL Service
Feb 07 '11 at 05:46 AM
Steinar
(comments are locked)
|
|
"... If none of the other answers help you then stand up in your office and shout "Who deleted table -inserttablenamehere- ?" and then look for the most embarrassed person avoiding your attention ..." This doesn't always work. A developer came to me demanding to know who deleted 3 tables he had been using. I had tracing or Compliance manager running at the time ..... took a look ... turns out he deleted his own tables, and either forgot, or somehow didn't realize he'd done it. This was a dev box though, right? You don't let no steenking devs play on your prod boxes.
Oct 15 '10 at 07:19 AM
WilliamD
(comments are locked)
|
|
For the default trace you can get object-Creation, object-Deletion and object-Alteration events, and from all these, you can get the ApplicationName, ClientProcessID, HostName, LoginName, LoginSid, NTDomainName, and NTUserName. In other words, they can run, but they can't hide. I use fn_trace_gettable to query the default trace to see who is fiddling with the database. There are plenty of examples of its use around.
(comments are locked)
|
|
If none of the other answers help you then stand up in your office and shout "Who deleted table -inserttablenamehere- ?" and then look for the most embarrassed person avoiding your attention ... Seriously though, unless you have something that the other answers have suggested in place before the drop took place then you wont find it. The best you can do is see who has permission to drop tables from the security settings on the server/database and then send a polite email to all of those people about how the table is missing and that if anyone needs to drop an object can they make sure noone else needs it before they run the script. +1 for the office intimidation technique. It works better if you have the reputation (think ScaryDBA!).
Oct 13 '10 at 01:52 AM
WilliamD
Threatening to break an arm usually works. No +1 though 'cause I think @WilliamD nailed it.
Oct 13 '10 at 04:39 AM
Grant Fritchey ♦♦
(comments are locked)
|
1 2 next page »

