构建服务器和存储过程的方法

发布于 2024-08-16 19:01:09 字数 228 浏览 2 评论 0原文

我被任命负责为我们的办公室设置构建服务器。目前,我们将所有查询放入 SQL 2000 服务器中的存储过程中。这是手动完成的,不会生成任何 SQL 文件或将其放入 SVN。

我所追求的是一种处理构建服务器的好方法,该服务器可以从数据库获取所有存储过程。

我猜这可能是不可能的/实践,并且我很确定这不是最佳实践。我意识到一种解决方案可能是开始创建 SQL 脚本文件并将它们放入 SVN 中,以便可以提取和处理它们。

I have been put in charge of looking at setting up a build server for our office. We currently put all queries into stored procedures in SQL 2000 server. This is done manually and no SQL files are produced or put into SVN.

What I am after is a good way of dealing with having a build server that can get all the stored procs from a DB.

I am guessing this might not be possible / practice and am pretty sure not the best practice. I realize one solution could be to start creating SQL script files and putting them into SVN so they can be picked up and dealt with.

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

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

发布评论

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

评论(1

彡翼 2024-08-23 19:01:09

你已经回答了你自己的问题。在你开始进一步深入你真正不想陷入的困境之前,将这些东西放入源代码管理中。

一旦完成,我们成功使用的一种方法是拥有脚本的初始快照集,然后是版本编号的脚本文件夹更改,并将整个数据库版本号存储在专门用于此目的的数据库表中。然后,我们编写了一个实用程序来组装自存储版本号以来的所有更新脚本,运行它们并更新版本号。这与我们的构建脚本集成,该脚本通过自动构建针对开发数据库运行。时间表等等当然取决于你。

强烈建议您使所有数据库脚本也可以安全地重复。

You have answered your own question. Get these things into source control before you start digging yourself further into a hole you really don't want to be in.

Once done, an approach we have used successfully is to have an initial snapshot set of scripts, then version numbered script folders for changes, with the overall database version number stored in a database table specifically for that purpose. We then wrote a utility to assemble all the update scripts since the stored version number, run them, and update the version number. This integrated with our build script that was run against the dev DB by an automated build. Schedules and so on are of course up to you.

Would strongly advise you make all DB scripts safely repeatable as well.

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