我们如何迁移到使用VS2005的数据库项目?

时间:2023-01-16 18:31:23

At my company, our current method of updating the database is to connect using the Server Explorer in VS2005, then modify the stored procedures by opening them and editing. The devs here seem to enjoy that "write and save it like it's code" mentality. It is pretty convenient, how it automatically turns Create into Alter and runs the scripts against the existing database when we need to tweak something.

在我的公司,我们当前更新数据库的方法是使用VS2005中的服务器资源管理器进行连接,然后通过打开和编辑来修改存储过程。这里的开发人员似乎喜欢“编写并保存它就像它的代码”心态。它非常方便,当我们需要调整某些内容时,它如何自动将Create转换为Alter并在现有数据库上运行脚本。

Recently, this bit us pretty hard during a server crash when we lost a lot of changes that hadn't gotten backed up. I'm pushing to move our SQL development where it belongs: in DB Projects so we can put them into SVN along with the othe code. The alternative is nightly back-ups of the database.

最近,在服务器崩溃期间,当我们丢失了许多尚未备份的更改时,这一点非常困难。我正在推动它所属的SQL开发:在DB Projects中我们可以将它们与其他代码一起放入SVN。另一种方法是每晚备份数据库。

I don't know much about DB projects though, or how the workflow with them is. I'm afraid that if I can't get something of similar utility to their current model, they just won't switch. Any thoughts on maintaining our current working model, but switching over to DB Projects?

我不太了解DB项目,或者它们的工作流程如何。我担心如果我不能得到与他们当前型号类似的功能,他们就不会切换。有关维护我们当前工作模式的任何想法,但切换到DB项目?

1 个解决方案

#1


If the developers make the rules (and your post sounds like they do), you can only proceed if the new workflow is "better" to them. Being a developer myself, I think that's the way it should be. I've seen some non-developers think up pretty nonsensical development processes, and force them on the developers to everyone's detriment.

如果开发人员制定规则(并且您的帖子听起来像他们那样),那么只有新工作流程对他们“更好”时才能继续。作为一名开发人员,我认为应该是这样的。我见过一些非开发人员认为非常荒谬的开发过程,并强迫开发人员对每个人都有害。

If you're thinking about VS DB projects, you'd first test if VS DB actually works with your database. If it does, you'd have to set up a big chance in process: the "true" copy of the database is now in VS DB instead of the database server.

如果您正在考虑VS DB项目,那么首先要测试VS DB是否真正适用于您的数据库。如果是这样,你必须设置一个很大的机会:数据库的“真实”副本现在在VS DB而不是数据库服务器中。

Another way out is to backup the development server regularly. If you back it up daily, and a transaction log backup every hour, it becomes very hard to loose a significant amount of work.

另一种方法是定期备份开发服务器。如果您每天备份它,并且每小时备份一次事务日志,则很难完成大量工作。

Or create a scheduled job that writes the entire database definition to a text file. (Script all objects in database.) These files are usually very small, so you can keep a long backlog.

或者创建一个将整个数据库定义写入文本文件的预定作业。 (编写数据库中的所有对象。)这些文件通常非常小,因此您可以保留很长的积压。

Many respected bloggers seem to think storing database definitions in SVN is a good idea. See this coding horror post, or related Stack Overflow related question How do I version my MS SQL database in SVN.

许多受人尊敬的博主似乎认为在SVN中存储数据库定义是个好主意。请参阅此编码恐怖帖子或相关的Stack Overflow相关问题如何在SVN中对我的MS SQL数据库进行版本控制。

Talk it over with the developers and see what you can agree on.

与开发人员讨论,看看你能达成一致意见。

#1


If the developers make the rules (and your post sounds like they do), you can only proceed if the new workflow is "better" to them. Being a developer myself, I think that's the way it should be. I've seen some non-developers think up pretty nonsensical development processes, and force them on the developers to everyone's detriment.

如果开发人员制定规则(并且您的帖子听起来像他们那样),那么只有新工作流程对他们“更好”时才能继续。作为一名开发人员,我认为应该是这样的。我见过一些非开发人员认为非常荒谬的开发过程,并强迫开发人员对每个人都有害。

If you're thinking about VS DB projects, you'd first test if VS DB actually works with your database. If it does, you'd have to set up a big chance in process: the "true" copy of the database is now in VS DB instead of the database server.

如果您正在考虑VS DB项目,那么首先要测试VS DB是否真正适用于您的数据库。如果是这样,你必须设置一个很大的机会:数据库的“真实”副本现在在VS DB而不是数据库服务器中。

Another way out is to backup the development server regularly. If you back it up daily, and a transaction log backup every hour, it becomes very hard to loose a significant amount of work.

另一种方法是定期备份开发服务器。如果您每天备份它,并且每小时备份一次事务日志,则很难完成大量工作。

Or create a scheduled job that writes the entire database definition to a text file. (Script all objects in database.) These files are usually very small, so you can keep a long backlog.

或者创建一个将整个数据库定义写入文本文件的预定作业。 (编写数据库中的所有对象。)这些文件通常非常小,因此您可以保留很长的积压。

Many respected bloggers seem to think storing database definitions in SVN is a good idea. See this coding horror post, or related Stack Overflow related question How do I version my MS SQL database in SVN.

许多受人尊敬的博主似乎认为在SVN中存储数据库定义是个好主意。请参阅此编码恐怖帖子或相关的Stack Overflow相关问题如何在SVN中对我的MS SQL数据库进行版本控制。

Talk it over with the developers and see what you can agree on.

与开发人员讨论,看看你能达成一致意见。