December 11, 2009

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


Did you like this post?
kick it on DotNetKicks.com
subscribe via rss subscribe via e-mail
print this post follow me on twitter


About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal

 
  Feedback:

comments

2 Responses to "Retrieve a Report of all Schema Changes within a SQL Server 2008 Database"
  1. Anonymous said...
    September 10, 2010 at 11:42 AM

    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.

  2. Suprotim Agarwal said...
    September 10, 2010 at 6:56 PM

    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.

 

Copyright © 2009-2014 All Rights Reserved for SQLServerCurry.com by Suprotim Agarwal | Terms and Conditions