I am trying to copy changes from DatabaseA to DatabaseB, however I don't know exactly what those changes were.
Is there a SQL script around that will find objects that are different between the databases, then generate a script to update DatabaseB to match DatabaseA?
I'm using SQL 2005, and I don't want to lose the existing data in DatabaseB
Try DBComparer.
There are schema and data compare tools from Red Gate that do exactly what you're looking for. There are also some others in the market, like Apex SQL Compare. But, if you're fortunate enough to have Visual Studio 2010 Premium or Ultimate edition, there is a compare tool built in to those versions.
http://www.apexsql.com/default.aspx
http://www.red-gate.com/products/sql-development/sql-compare
http://msdn.microsoft.com/en-us/library/dd193250.aspx
Otherwise, you're going to have to use linked servers and a lot of querying against the INFORMATION_SCHEMA.
Some of those software tools you can use on a trial basis and probably get what you need without buying a full license.
I have used "SQL Compare" and "SQL Data Compare" by Red Gate Software, and they work like a charm. I do not suppose that there exists a script to do the same job, because if it existed, then there would be no use and no market for these products.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With