Are there any tools available for validating a database schema against a set of design rules, naming conventions, etc.
I'm not talking about comparing one database to another (as covered by this question).
I want to be able to say "What in this database doesn't meet this set of rules".
Some examples of the type of rules I'm talking about would be like:
- Primary key fields should be the first in the table.
- Foreign keys should have an index on that field.
- Field names ending 'xxx' should be of a certain type.
- Fields with a constraint limiting it it certain values it should have a default.
I've written a bunch of scripts to do this in the past and was wondering if there was something generic available.
Ideally I'd like something for SQL Server, but if you're aware of something for other databases it may be useful to know about them too.