[英]Track changes made to a database
Background: 背景:
I have a MS SQL Server database and I want to track changes to it. 我有一个MS SQL Server数据库,我想跟踪它的更改。 For example if a column needed to be added or removed or a table needed to be dropped.
例如,如果需要添加或删除列或需要删除表。 Something similar to Version control for regular code.
与常规代码的版本控制类似。
The problem: 问题:
While looking around I saw that there were some tools that can be used: 环顾四周时,我发现可以使用一些工具:
I am more interested in knowing if either of these tools will track changes to my database? 我对知道这两个工具中的任何一个是否可以跟踪对我的数据库的更改更感兴趣。 More specifically I have a TFS server that is the source control for my MVC code, can I use either of these with TFS?
更具体地说,我有一个TFS服务器,它是我的MVC代码的源代码控制,我可以将这两个服务器与TFS一起使用吗? Will it allow us to restore from older versions?
它将允许我们从旧版本还原吗? Will it allow multiple developers to work on the database simultaneously?
它将允许多个开发人员同时处理数据库吗?
For this type of work, ApexSQL Source Control shown to be all that you need. 对于此类工作,ApexSQL源代码控制显示为您所需要的。 With this SSMS add-in you can work directly on a database, and all of your changes will be tracked in real time .
使用此SSMS加载项,您可以直接在数据库上工作,并且所有更改都将实时跟踪 。
Yes, several developers can work in the same time on the same database. 是的,几个开发人员可以在同一数据库上同时工作。 When one developer works on a one or several objects, other developers can see which those objects are, and until the first one does not finish changing the others cannot change that object, they will not be allowed to.
当一个开发人员处理一个或多个对象时,其他开发人员可以看到那些对象,并且直到第一个对象完成更改之前,其他开发人员无法更改该对象,否则将不允许它们。 If by any case, object is changed wrong, previous version or any earlier version can be restored at any moment.
无论如何,如果对象更改错误,则可以随时还原以前的版本或任何早期版本。
This add-in has all necessary options and features to allow the developers to work without losing time for checking changes made against object, since the add-in does that for them. 该外接程序具有所有必要的选项和功能,以使开发人员可以在不浪费时间检查对对象所做的更改的情况下工作,因为该外接程序会为他们执行此操作。 And you can always see by whom, when and what that change is.
而且,您始终可以看到更改的对象,时间和对象。
Being in the database version control space for 5 years (as director of product management at DBmaestro ) and having worked as a DBA for over two decades, I can tell you the simple fact that you cannot treat the database objects as you treat your Java, C# or other files and save the changes in simple DDL scripts. 我已经在数据库版本控制领域工作了5年(担任DBmaestro产品管理总监 ),并且已经担任DBA超过20年了,我可以告诉你一个简单的事实,即当您处理Java时,您不能对待数据库对象, C#或其他文件,并将更改保存在简单的DDL脚本中。
There are many reasons and I'll name a few: 原因有很多,我仅举几例:
There are many more, but I think you got the picture. 还有很多,但我想您已经知道了。
What I found that works is the following: 我发现有效的方法如下:
An article I wrote on this was published here , you are welcome to read it. 我在此发表的一篇文章已发表在这里 ,欢迎您阅读。
If you're looking for a product that will track changes into TFS from your SQL Server automatically, I'd invite you take a look at our product, Sql Historian . 如果您正在寻找一种产品,该产品将自动从您的SQL Server跟踪到TFS中的更改,我邀请您来看看我们的产品Sql Historian 。 It's different from most other SQL version control systems (including the ones you've listed) in that it does not require developers to perform a check-in ritual to synchronize version control with what's already committed to the db.
它与大多数其他SQL版本控制系统(包括您列出的版本)不同,因为它不需要开发人员执行签入仪式以将版本控制与已提交给数据库的内容同步。
However, features common with Sql Historian and the other two systems you mention are: working with TFS, the ability to view older versions of your db objects, and allowing multiple users on the db at the same time. 但是,Sql Historian和您提到的其他两个系统具有的共同功能是:使用TFS,查看数据库对象的旧版本的功能以及允许多个用户同时在数据库上使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.