October 24, 2007 at 9:14 am
Every now and then we wonder which developer modified the schema of a certain table. (We haven't enabled auditing). Is there a system table (e.g. sysobjects) that could provide us the answer? If not, is there any other way to find out?
TIA,
Barkingdog
October 24, 2007 at 9:27 am
I'm not sure about system tables but you can create DDL triggers in 2005. So you can easily create a trigger that runs any time a table is created, modified etc and store the information and even the code they ran into a logging table you create somewhere.
Another option is to create an on going trace or series of traces that just check for DDL events. The triggers will be easier to implement though.
Kenneth Fisher
Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]
October 24, 2007 at 11:01 am
If it didn't happen too long ago, you can see a history of schema changes in a database by using the "Schema Changes History" report on the Summary tab in SSMS.
Click on the database in SSMS and press F7 to bring up the Summary page. Pull down the Report list and choose "Schema Changes History".
You don't get as much information as you do from a DDL trigger, but it's good for a quick look.
Greg
Greg
October 24, 2007 at 8:21 pm
In the LOG directory, there should be SQL Profiler traces which are created by default with SQL Server 2005 to track this sort of thing. You might be able to extract the information out of them.
K. Brian Kelley
@kbriankelley
October 24, 2007 at 11:45 pm
Barkingdog (10/24/2007)
Every now and then we wonder which developer modified the schema of a certain table. (We haven't enabled auditing). Is there a system table (e.g. sysobjects) that could provide us the answer? If not, is there any other way to find out?TIA,
Barkingdog
As some have said, you can add a schema trigger to the table... but, I've gotta ask... your developers can modify tables in production>:blink:
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply