如何使用VSS(或其他系统)进行数据库管理和版本控制?

发布于 2024-09-24 03:44:40 字数 238 浏览 1 评论 0原文

在 VSS 中对数据库对象(触发器、SP 和其他元素)进行版本控制的最佳方法是什么?其方式类似于我们在 VSS 中存储源代码并在 Microsoft Visual Studio 中访问它的方式?

我们希望在 VSS 或类似工具中检查数据库元素的输入和输出,以便我们可以将数据库对象存储在中央位置,并且还可以对数据库元素进行版本控制,例如存储过程的版本历史记录。

我们目前使用 SQL Server 2005 作为我们的数据库引擎。

What is the best way to version database objects (Trigger, SPs, and other elements) in VSS in a similar fashion to the way that we store source code in VSS and access it in Microsoft Visual Studio?

We would like to check database elements in and out in VSS or a similar tool so that we can store database objects in a central location, and also so that we can have versioning of database elements, for example, version history of stored procedures.

We currently use SQL Server 2005 as our database engine.

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

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

发布评论

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

评论(2

顾铮苏瑾 2024-10-01 03:44:40

如果您使用 VS,控制源对象的最简单方法是使用 Visual Studio 中的“数据库”项目模板创建数据库项目。
alt text

整个数据库项目可以与源代码管理(在您的情况下为 VSS)关联,然后所有数据库对象脚本版本化。

需要注意的一个非常重要的一点是,确保开发人员摆脱直接更新/更改数据库中对象的旧习惯,因为这样做不会阻止他们这样做。摆脱这种困境的一个简单方法是确保数据库项目像您的代码一样定期构建和部署(持续集成)。
这将确保如果直接对数据库进行更改,它们将会丢失,从而自动向开发人员灌输行为更改。

请参阅链接获取分步教程< /a> 关于如何开始使用数据库项目。
屏幕截图是针对 VS2010 的,但 DB 项目自 VS 2005 以来就已经存在,并且或多或少都在相同的路线上。非常容易使用。

If you are using VS, the easiest way to control your source objects is to create a Database project using the "Database" project template in Visual Studio.
alt text

The entire database project can be associated with source control (VSS in your case) and then all your DB object scripts are versioned.

A very important point to note is to make sure that Developers get out of their old habits of directly updating / changing objects in the DB because doing this will not stop them from doing so. An easy way out of that dilemma is to ensure that the DB project is built and deployed periodically(Continuous integration) just like your code is.
This will ensure that if changes are directly done to DB, they will be lost and hence automatically inculcate the behavioural change in developers.

Refer link for a step by step tutorial as to how to get started using a DB project.
Screen shots are for VS2010 but DB projects have been around since VS 2005 and more or less on the same lines. Very easy to use.

吻泪 2024-10-01 03:44:40

如果您愿意使用 Subversion 或 TFS,并使用 SSMS 来更改数据库,Red Gate 的 SQL Source Control 可能是适合您的工具。

http://www.red-gate.com/products/SQL_Source_Control/

[编辑]
我们现在添加了 VSS 和 SourceGear Vault 支持。尝试早期访问版本:
http://www.red-gate.com/MessageBoard/viewtopic。 php?t=12265

If you're willing to use Subversion or TFS, and are using SSMS to make your database changes, Red Gate's SQL Source Control maybe a tool that would work for you.

http://www.red-gate.com/products/SQL_Source_Control/

[Edit]
We've now added VSS and SourceGear Vault support. Try the early access build:
http://www.red-gate.com/MessageBoard/viewtopic.php?t=12265

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