Visual Studio 2010 数据库项目架构比较和合并问题TFS
我在使用 TFS 的 Visual Studio 2010 Ultimate 中处理数据库项目时遇到问题。下面描述了我使用的工作流程:
- 我通过 SQL Server Management Studio 在本地修改 SQL 架构。
- 接下来我打开 Visual Studio 数据库项目 &执行“模式比较”操作。
- 我选择具有最新更改的本地数据库作为“源架构”,选择“目标架构”作为数据库项目。
- 接下来,我查看“架构比较”结果,并为我不想更改的项目的“更新操作”选择“跳过”。对于我确实想要更改的项目,我选择适当的“更新操作”。
- 完成后,我选择“写入更新”命令将更改应用到数据库项目。
我遇到的问题是,当我查看数据库项目时,我告诉忽略的一些数据库表通过注释掉数据库创建脚本在数据库项目中进行了更新。
例如,如下所示:
/*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:
- I work locally modifying a SQL schema via SQL Server Management Studio.
- Next I open up the Visual Studio database project & perform a "Schema Compare" operation.
- I choose my local database with the latest changes as the "Source Schema" and the "Target Schema" as the database project.
- 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".
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我通过一位同事找到了这个问题的解决方案。
事实证明,在执行架构比较时您需要执行一个额外步骤:
步骤 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.