March 25, 2010 at 8:52 am
Afternoon,
Is there anyway of finding out which database user has created a table?
What's happened is that we have a table holding all job details, this has several constraints on fields and a trigger that is used to send data to another table for some external work we do.
The otherday my work I do for external people stopped producing data, first thought was the time of year it was not much work would be going through. but this didnt feel right. further investigation shows the original table has been renamed and a new jobs table created, but with the missing parts.
How can I find which database user has done this?
March 25, 2010 at 9:01 am
Question that I have....is why would you ever allow a user to modify in any way, the DDL?
You need to remove all permissions for that.
Unless you have some type of auditing, such as DDL auditing with SQL 2008, then no, there is no way of knowing that I can think of.
Andrew SQLDBA
March 25, 2010 at 9:11 am
DDL triggers are also available in SQL Server 2005, as is event notification. Both could be used to set up DDL auditing.
March 25, 2010 at 9:16 am
Sorry
I meant to type 2005. My mind is not working well today.
Andrew SQLDBA
March 25, 2010 at 10:07 am
the default trace would have that information if not too much time has past; the default trace captures DDL, but not DML changes.
easiest way is to point SSMS to the database in question,right click on Reports>>Standard Reports>>Schema Changes History.
When you expand on the item of interest, you can see the login that did the deed.
I hope your shop doesn't have everyone logging in as "sa"
Lowell
March 25, 2010 at 2:19 pm
Thanks so much for this I have now found who the culprit is 🙂
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply