I am working on a database with 1000+ columns. On regular basis, the DBA and developers add new fields to the columns. I was wondering is there is way to figure which columns has been modified or have new fields added to it.
I am not sure if this is a good idea but you could but a trigger on the syscolumns table that e-mailed / stored in a table / did something… when a transaction occurred in that table. That would alert you to any changes.
You may need to get a 3rd party app like RedGates SQL Compare. Easiest way to go. You create a snapshot of the DB schema as it is today, then later you can compare that snapshot to the current schema and surface all the changes.
The other way is to create your own version of the tool and do comparisons using the information_schema.* views and such.
Going the trigger in a system table way should be avoided. System tables can, and are frequently, tweaked by service packs and upgrades thus rendering your trigger/application null and void.
Let alone the performance issues you "may" incurr when changing system tables.
Actually ... you can create triggers on system tables. Just created on on the sysjobs table ... then deleted it - lol.
You just need to go to the properties of the server and choose the Server Settings tab. There you can set the "Allow modifications to be made directly to the system catalogs" check box.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.