问题描述
Visual Studio SQL Server Data Tools(任何版本)是否支持更改默认比较映射,用于具有不同名称和/或不同架构的对象?
Does Visual Studio SQL Server Data Tools (any version) support changing the default comparison mappings, for objects with different names, and/or in different schemas?
例如,我想比较两个 SQL Server 数据库中的表,但是这些表在每个数据库中的架构不同:
For example, I want to compare tables in two SQL Server databases, but the tables are in different schemas in each database:
database1.SchemaA.MyTable
database1.SchemaA.MyTable
database2.SchemaB.MyTable
database2.SchemaB.MyTable
这些表可以使用 SSDT 相互比较吗,如果可以,我该怎么做?我找不到任何映射选项或文档.
Can these tables be compared with each other using SSDT, and if so how can I do it? I cannot find any mapping options or documentation.
推荐答案
据我所知,不,如果它们在不同的 schema中,你不能使用
SSDT
进行比较代码>.database
无关紧要,您可以在运行 schema compare
时指定 connection
和 database
,但不能架构
.
As far as I know, no, you cannot do the comparison using SSDT
if they are in different schema
. The database
doesn't matter though, you could specify the connection
and database
when running schema compare
, but not the schema
.
一种解决方法使其以不太理想的方式工作的方法是:
One workaround to get it working in less than ideal way would be to:
- 在本地部署您的 SchemaA.MyTable
- schema部署成功后,将SchemaA.MyTable的表定义替换为SchemaB.MyTable的表定义
- 运行
sqlcompare
,将您的项目作为源,将本地数据库(您在步骤 1 中部署项目的位置)作为目标.
- deploy your SchemaA.MyTable locally
- after the schema has been deployed successfully, replace the table definition of SchemaA.MyTable with that of SchemaB.MyTable
- Run
sqlcompare
with your project as the source and the local db (where you deployed your project in step 1) as the target.
这篇关于Visual Studio SQL Server 数据工具比较映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!