1

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.

M.J.
  • 51
  • 3
  • I'm having the same problem, did you find a solution back then? See https://stackoverflow.com/questions/50236164/comparing-schemas-ignoring-the-schema-name – André Stannek May 09 '18 at 07:52
  • 1
    No, unfortunately I didn't find a way to do this with SSDT. I ended up using the Redgate comparison tools instead, which do support this type of comparison. – M.J. May 09 '18 at 11:09
  • @MJ too bad :-( Thanks for replying! – André Stannek May 09 '18 at 11:37

1 Answers1

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.
haku
  • 4,105
  • 7
  • 38
  • 63
  • Thanks for the workaround, but would like something a little more easily repeatable. I'm thinking I'll probably just need to use a different comparison tool. – M.J. Aug 02 '17 at 15:57