A lot of our data is in a database originally provided to us by
a vendor. We can add tables to the database (although we prefix
them with our own company name), and stored procedures and our
own triggers, as well. However, we have been hesitant to
change the vendor's tables (despite serious flaws), as our
changes may get lost whenever we put in a new version of their
software.
I would like to be able to run a script that will check the
database for each of our changes, and put the change back in
if it was missing. These are the main things I'd like to
check:
Foreign keys are present.
Check constraints are present.
Specific triggers are absent (The vendor has a bad habit
of implementing foreign keys and simple checks in
triggers. The foreign key checks cause us a lot of
locking trouble). If present, and not the same as the
one that was originally removed, report it instead of
removing it.
Calculated fields are present.
Indexes are present. (especially if we can check what is
indexed, and what index is clustered)
Any tips? Books to read? Software to buy?
Thanks,
Bill