Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Trigger to track changes in a Database

Author  Topic 

Srujan4994
Starting Member

7 Posts

Posted - 2014-07-03 : 08:34:03
Hi,

I have a requirement. I am having a database which is having views,procedures and tables. Many users are having access to the database. If i want to track all the schema changes happening in the database how to achieve that? As in i have used some tables in a procedure and someone might change the column or drop the column. So it is going to have impacts on my procedure. I need a trigger which tracks all the changes done in a database and the impacts those changes are going to make.Hope i get a solution for this.

Thanks,
Srujan

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-07-03 : 09:13:28
Changes to schema should be a rare event, or at the very least, a well-controlled event. So, I would suggest that regular users should not be granted permissions to add/drop columns. If they want to do that, they should do that in a development environment, evaluate the impact of such changes, test it, and then deploy that to production. Usually it is not the person/group that develops that is responsible for deployment - separation of powers principle.

That said, if you want to see the schema changes, you can use the standard report that you can access by right-clicking on the database name in SSMS object explorer and selecting Reports -> Standard Reports -> Schema Changes History.
Go to Top of Page

Srujan4994
Starting Member

7 Posts

Posted - 2014-07-04 : 01:56:04
Thanks James for the reply. But I am looking for a trigger which does the impact analysis of the changes caused in the tables which leads to braking down of procedures .




Thanks,
Srujan
Go to Top of Page
   

- Advertisement -