4

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.

2 Answers 2

1

One way to accomplish this would be to script out an entire database and then apply rules consisting of regular expressions to the script. SSW's commercial tool does something similiar for SQL Server.

Sign up to request clarification or add additional context in comments.

1 Comment

That appears to be just what I was looking for. Thanks.
1

A tool called SQLCop is doing what your asking for, but I don't believe it actually allows you to write rules yourself.

http://sqlcop.lessthandot.com/detectedissues.php

1 Comment

Its malware reporting, beware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.