简体   繁体   English

如何比较两个数据库?

[英]How to compare two databases?

I have two databases that are similar, but not the same. 我有两个相似的数据库,但不一样。 DB 1 is the old one and DB2 is the updated one with lots of new tables, columns, procs, constraint etc. DB 1是旧的,DB2是更新的,具有许多新的表,列,过程,约束等。

I need to write an update script in order to update DB1 database. 我需要编写更新脚本才能更新DB1数据库。 These databases have lots of tables and stored procedures. 这些数据库有很多表和存储过程。 Is there any way to get the differences in two database other than manually. 除了手动之外,有没有办法在两个数据库中获得差异。

Buy red-gate's SQL Compare. 购买red-gate的SQL Compare。 You wil never regret spending the money. 你永远不会后悔花钱。

There are a number of software tools (eg Red Gate) that enable you to compare databases easily. 有许多软件工具(例如Red Gate)可以让您轻松地比较数据库。

Also, try this script; 另外,试试这个脚本; it's free and it should also work. 它是免费的,它也应该工作。

Cheers 干杯

To pile on to everyone suggesting Red Gate's tool, it should be noted that this tool can generate scripts to update the second database. 为了向所有人建议使用Red Gate的工具,应该注意这个工具可以生成脚本来更新第二个数据库。

The awesome thing about red gate (besides the fact that they're an SO sponsor...) is that if you have the SQL Toolbelt with an active subscription, you will automatically get any new tools added. 关于红门的好消息(除了它们是SO赞助商......)如果你有一个有效订阅的SQL Toolbelt,你将自动添加任何新工具。 They recently released SQL Source Control, and I got it included as part of my SQL Toolbelt subscription. 他们最近发布了SQL Source Control,我把它作为我的SQL Toolbelt订阅的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM