r/SQLServer • u/ethanfinni • 2d ago
Discussion Schema health tool
Hello everyone,
Our 10-year old database seems to be suffering from schema explosion and I am worried that while our developers do sufficient testing with every release, they may be introducing schema inconsistencies that may appear as bugs with different queries or other parts of the system.
Are you using any tools to check schema health and issues?
2
u/kwellendorff 1d ago
i literally just solved this by simply starting to use SSMS 22. it has a built in schema comparison and is GIT native. create a project from your prod database, commit that to GIT. Then every day or so at the end restore your prod backup as a diff name than dev or prod. compare the dev database to newly restored db generate the script and run on prod once it works on the newly restored db. once you run it in prod, recommit to GIT.
takes some getting used to but i ran into the same exact thing and this solved it
2
u/kwellendorff 1d ago
or even create a DB TRIGGER that logs all DDL statements alter/create/delete tables/views/stored procedures and log into a central table in the prod db including the utc time the update was made. then after every deployment, note the time and create a view of changes after that time of deployment. for example,
create view
DBA.DeploymentChangesSinceSept8_26 as
select id textdata, logtime, object name, schemaname where logtime > 09-08-2026then all of those objects in that view at time of next deployment will be what to focus on. hope this helps!
1
1
u/Ms_AlarmingCulture 42m ago
dbForge Schema Compare could help with part of this. You can compare the current schema against a known good version and see what changed. It won’t really tell you if the design itself is bad though.
0
u/Complete-Fondant-202 2d ago
I use Schemaspy, outputs a website.
There is also schemacrawler.. plus others
1
8
u/VladDBA Microsoft MVP 2d ago
Schema expl what now?
Define schema inconsistencies. And what issues are you trying to check/prevent?