Monitor changes to table column names

  • New to the scene so watz up to the house!!

    My question?

    I want to know imediatly when someone changes a column name or data type of a table.

    DDL triggers will tell alert me on data type changes but not column name changes.

    I can certainly create my own trigger but was wondering if something already exist and I just havent come accross it yet. Just trying to avoid re-inventing the wheel. Thanks

  • Are you sure a DDL trigger won't tell you? Changing a column name is an alter table statement, so it should get caught by a ddl on alter table.

     

     

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • actually, from looking in the help and actually testing the DDL trigger, the renaming of the column appears to be using the sp_rename stored procedure which in turn uses the DBCC RENAMECOLUMN statement.

    This statement is undocumented as stated here: http://www.sqlservercentral.com/columnists/jreade/sqlserver2005dbcccommandquickreference.asp

    this procedure is not part of the ddl alter table event and therefore would not cause the alter table trigger to fire.

     

  • That's interesting.

    I'll take a look this weekend, if I get a chance, see if I can find a way to trigger it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks yall for taking the time.  Got some good leads.

    Another buddy of mine menitoned sp_foreachtable & sp_foreachdb as possible work arounds.  I'll take a stap when I get some time.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply