Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I maintain consistent DB schema accross 18 databases (sql server)?

We have 18 databases that should have identical schemas, but don't. In certain scenarios, a table was added to one, but not the rest. Or, certain stored procedures were required in a handful of databases, but not the others. Or, our DBA forgot to run a script to add views on all of the databases.

What is the best way to keep database schemas in sync?

like image 584
Jim Avatar asked Mar 31 '26 13:03

Jim


2 Answers

For legacy fixes/cleanup, there are tools, like SQLCompare, that can generate scripts to sync databases.

For .NET shops running SQL Server, there is also the Visual Studio Database Edition, which can create change scripts for schema changes that can be checked into source control, and automatically built using your CI/build process.

like image 180
Guy Starbuck Avatar answered Apr 03 '26 03:04

Guy Starbuck


SQL Compare by Red Gate is a great tool for this.

like image 32
Luke Bennett Avatar answered Apr 03 '26 01:04

Luke Bennett



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!