Retrieve a Report of all Schema Changes within a SQL Server 2008 Database

Some of the most obvious things are often overlooked!

During one of my discussions with a client, I was asked for a simple way to detect all schema changes (DDL Operations) in the SQL Server database and to generate a report out of it. These people were interested in only the DDL operation performed and who performed it. To detect changes, they were planning to create a trigger, detect changes and then write it to a log file.

I advised them to use the Database Standard Reports which does the job for us

Open SSMS 2008 > Right Click a Database > Report > Standard Reports > Schema Changes History

image

The report displays you a history of all committed DDL statement executions within the Database

image

2 comments:

  1. What privileges are required to generate this report? Can a user with DBO on that database generate the report? We are seeing an 'you do not have permission to run sys.traces' error. The sysadmin can run the report.

    ReplyDelete
  2. Most of these reports are internally calling a DMV. Check the 'Required Permission' section in this link over here Querying Dynamic Management Views. So you can run the profiler to check the DMV's being called and grant the SELECT permission to the user on that DMV.

    ReplyDelete