SQL仅导入不同的记录

发布于 2024-12-10 12:59:54 字数 285 浏览 0 评论 0原文

很抱歉,如果之前已经回答过这个问题,但我无法在任何地方找到答案。我在服务器“A”上有一个 SQL 数据库,该数据库已进行更新等,同时服务器“B”上也有相同的数据库。

现在的问题是,一些网站比其他网站移动得更快,并且这些网站正在服务器“B”上进行更新等,而其他网站(可能需要 2 或 3 周的注册时间)则在服务器“A”上进行更新。

问题是,我无法从服务器“A”的 .bak 文件导入到服务器“B”,因为我丢失了服务器 B 的所有数据。无论如何,只从“A”导入与服务器“B”不同的数据?有道理吗?

先感谢您...

So sorry if this has been answered before, but I cannot find an answer anywhere. I have a SQL database on server "A" that has had updates etc etc on it at the same time the same database is on server "B".

Now the issues is, some websites moved over sooner than others and those were being updated etc on server "B" while the other websites (maybe 2 or 3 weeks worth of signups) where being updated on server "A."

Question is, I can't do an import from server "A's" .bak file to server "B's" cause I lose all of server B's data. Anyway to only import data that is different to server "B" from "A?" Make sense?

Thank you in advance...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

歌枕肩 2024-12-17 12:59:54

我建议查看 RedGate 的 SQL Data CompareSQL Compare。您可以创建一次性脚本,但这些工具在这种情况下确实会派上用场。

听起来 SQL Data Compare 就是您现在需要的工具。它允许您比较两个数据库之间的数据(您可以选择单个表)并同步它们。在处理标识列和约束时它非常有用。

SQL数据比较:
http://www.red-gate.com/products /sql-development/sql-data-compare/

SQL 比较:
http://www.red-gate.com/products/sql -开发/sql-比较/

I would suggest taking a look at SQL Data Compare and SQL Compare from RedGate. You could create a one-time script, but these tools really come in handy for situations like this.

It sounds like SQL Data Compare is the tool you need right now. It allows you to compare data between two databases (you can select individual tables) and synchronize them. It's extremely useful when dealing with identity columns and constraints.

SQL Data Compare:
http://www.red-gate.com/products/sql-development/sql-data-compare/

SQL Compare:
http://www.red-gate.com/products/sql-development/sql-compare/

錯遇了你 2024-12-17 12:59:54

另请参阅 TSQL 的 MERGE 命令。

See also the MERGE command for TSQL.

無處可尋 2024-12-17 12:59:54

我过去曾使用 TableDiff.exe 来执行此操作。这里有一些关于使用它的好文章:

I have used TableDiff.exe in the past to do this. There is are some good articles on using it here:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文