Visual Studio 2010 数据库项目架构比较和合并问题TFS

发布于 2024-09-11 07:32:47 字数 651 浏览 3 评论 0原文

我在使用 TFS 的 Visual Studio 2010 Ultimate 中处理数据库项目时遇到问题。下面描述了我使用的工作流程:

  1. 我通过 SQL Server Management Studio 在本地修改 SQL 架构。
  2. 接下来我打开 Visual Studio 数据库项目 &执行“模式比较”操作。
  3. 我选择具有最新更改的本地数据库作为“源架构”,选择“目标架构”作为数据库项目。
  4. 接下来,我查看“架构比较”结果,并为我不想更改的项目的“更新操作”选择“跳过”。对于我确实想要更改的项目,我选择适当的“更新操作”。
  5. 完成后,我选择“写入更新”命令将更改应用到数据库项目。

我遇到的问题是,当我查看数据库项目时,我告诉忽略的一些数据库表通过注释掉数据库创建脚本在数据库项目中进行了更新。

例如,如下所示:

/*CREATE TABLE [SchemaName].[TableName] (
    [Col1]     BIGINT           IDENTITY (1, 20) NOT NULL,
    [Col2]     INT              NULL
);*/

问题是:既然我告诉比较忽略此表,那么它为什么要修改项目并注释掉代码?

I am experiencing an issue working with a database project in Visual Studio 2010 Ultimate with TFS. The following describes the work flow that I use:

  1. I work locally modifying a SQL schema via SQL Server Management Studio.
  2. Next I open up the Visual Studio database project & perform a "Schema Compare" operation.
  3. I choose my local database with the latest changes as the "Source Schema" and the "Target Schema" as the database project.
  4. Next I look at the "Schema Comparison" results and choose "Skip" for the "Update Action" on items that I do not want to change. For the items I do want to change I choose the appropriate "Update Action".
  5. When I am finished I then choose the "Write Updates" command to apply the changes to the database project.

The problem that I have is that when I look at the database project, some of the database tables that I told to ignore get updated in the database project by commenting out the database create script.

For example this is what one looks like:

/*CREATE TABLE [SchemaName].[TableName] (
    [Col1]     BIGINT           IDENTITY (1, 20) NOT NULL,
    [Col2]     INT              NULL
);*/

The question is: Since I told the compare to ignore this table then why did it modify the project and comment out the code?

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

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

发布评论

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

评论(1

剩一世无双 2024-09-18 07:32:47

好吧,我通过一位同事找到了这个问题的解决方案。

事实证明,在执行架构比较时您需要执行一个额外步骤:

步骤 4A - 为所有项目选择适当的“更新操作”后,您现在必须单击“刷新” ”按钮。执行刷新后,您可以继续执行步骤 5。

Ok people I found a solution for this issue via a fellow co-worker.

It turns out that there is an extra step you need to do while performing the Schema Compare:

Step 4A - After choosing the appropriate "Update Action" for all items you must now click the "Refresh" button. After you perform a refresh you may proceed to step 5.

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