问题
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?
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
database2.SchemaB.MyTable
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.
回答1:
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:
- 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.
来源:https://stackoverflow.com/questions/45439613/visual-studio-sql-server-data-tools-comparison-mappings