Question

I have two SQL Server (2000) databases. Both are used for the same project, but different versions. Basically, the old database is from our TEST environment. The new database is from the DEVELOPMENT environment. We also have an ACCEPTANCE, PRODUCTION and MAINTENANCE environment and they all contain the same project. (It's our development street, moving versions from D to T to A to P and finally M.)

Now, the development database structure has changed. A few tables have been added, indices are added or removed, fields have changed in type and nullable fields have become non-nullable, things like that. The test database needs to be upgraded with the new structure but without any loss of data. Right now, I'm doing this with a lot of manual labor. I keep a list of structural changes and once everything is ready, I write an update script to patch the old test database.

But as a software engineer, I'm just lazy by design. So, is there some easy tool somewhere which will compare the two database structures and generate an update script by itself?

(Only to change the structure, btw. No data manipulation!)

Was it helpful?

Solution

Take a look at Red Gate's SQL Compare..a complete live safer

OTHER TIPS

Yes, the best one in my opinion is by Red Gate

The SQL Toolbelt they offer is very good, which includes a bundle of tools, or you can just get SQL Compare on it's own. Not free (except for 14 day trial I think), but well worth the money

At work we've used a few tools; AdeptSql Diff and we were trialing Redgate-something-something. AdeptSql was significantly cheaper than Redgate, and while Redgate had a lot of very nice bells and whistles, since we already owned Adept we decided to stay with it.

http://www.adeptsql.com/

I'm sorry that I don't know any free tools offhand; I know that Redgate at least has a trial period.

I have used a *nix command-line tool called sqlt-diff which uses Perl SQL::Translater (SQLFairy) to generate diffs between SQL database schemas.

https://metacpan.org/pod/distribution/SQL-Translator/script/sqlt-diff

This is a free open-source tool. I did manually edit the diffs generated to customize them slightly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top