SQL Server Database Schema Validation Tool

Are there any tools to check the database schema for a set of design rules, naming conventions, etc.

I'm not talking about comparing one database with another (as described by this question ).

I want to say: "What does not match this set of rules in this database."

Some examples of the type of rules I'm talking about will be:
- Primary key fields should be the first in the table.
- Foreign keys must have an index in this field.
- Field names ending in "xxx" must be of a specific type.
- Fields with a restriction restricting it to certain values ​​must have a default value.

I wrote several scripts for this in the past and wondered if there was anything in common.

Ideally, I would like something for SQL Server, but if you know something for other databases, it might be useful to learn about them too.

+4
source share
2 answers

One way to achieve this is to use a script from the entire database, and then apply the rules of regular expressions to the script. The SSW commercial tool does something similar for SQL Server.

+1
source

A tool called SQLCop does what you ask for, but I don't believe that it really allows you to write the rules yourself.

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

+1
source

Source: https://habr.com/ru/post/1277561/


All Articles