在数据库之间导出/导入存储过程

发布于 2024-07-12 01:56:11 字数 485 浏览 3 评论 0原文

我有两个 SQL Server 2005 数据库,一个用于开发,另一个位于最终生产服务器上。 我想知道确保生产数据库具有完全相同的存储过程(数量和最新版本)的最快方法。

假设:

  1. 数据库具有相同的表架构。

  2. 生产数据库当前位于 使用并拥有比以下更新的数据 开发数据库

  3. 开发 数据库有存储过程 生产数据库中不存在

  4. 开发数据库不再有 [过时的]存储过程 目前在生产中发现 数据库。

  5. 开发数据库有 存储的更新版本 程序比目前的程序 在生产数据库中找到。

编辑:请注意,两个数据库的服务器不在同一网络上,并且生产数据库位于客户端防火墙后面(我们与服务器建立了 VPN,并且可以远程桌面进入)

I have two SQL Server 2005 databases, one is for development and the other is on the final production server. I would like to know the fastest way of ensuring that the production database has the exact same stored procedures (number and most recent version).

Assumptions:

  1. Databases have same table schema.

  2. Production database is currently in
    use and has more recent data than
    development database

  3. Development
    database has stored procedures that
    do not exist on production database

  4. Development database no longer has
    [outdated] stored procedures that
    are currently found on production
    database.

  5. Development database has
    more recent versions of stored
    procedures than those currently
    found on production database.

Edit: Note the servers for the two databases are not on the same network and production database is behind client's firewall (we have a VPN established with the server and can remote desktop in)

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

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

发布评论

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

评论(1

假情假意假温柔 2024-07-19 01:56:11

Redgate 的 SqlCompare 是执行此操作的绝佳工具。

它基本上为您提供了两个数据库之间所有存储过程和架构差异的差异,并为您提供了同步一组选定差异的选项,或生成一个脚本来执行相同操作。

SqlCompare by Redgate is a great tool for doing this.

It basically gives you a diff of all stored procedures and schema differences between two databases and gives you the option to sync up a selected set of differences, or generate a script to do the same.

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