1

I have a .NET project. When I do a SQL Server Schema Compare between what is on a local SQL Server 2017 database to Visual Studio in the direction of Database --> Project, the compare lists all tables, views, procedures and functions that are in the database under "Add".

It is unable to see the database objects in the project, so it thinks it needs to add everything to the project. Nothing shows in the Target object definition panel for any of the listed objects

If I do go ahead with the update to add a table to the project, E.G. Exhibit table, then it appears as Exhibit_1.sql in the project alongside the existing Exhibit.sql.

However, some changes were made to procedures in the database that showed up under "Change" so I was able to update them as normal

If I reverse the direction of the compare to Project --> Database, it lists all of the objects under Delete

  1. Local Database is SQL Server 2017 but was upgraded from 2008.
  2. Compatibility level is set to 2017 in the database properties in SQL Server Management Studio
  3. In Visual Studio I have set the Target Platform of the database to SQL Server 2017.
  4. I have ticked "Validate casing on identifiers" and Database collation is SQL_Latin_General_CP1_CI_AS on both
  5. Visual Studio is version v15.7.1 and .NET is 4.7.03056

Is there anything else I need to do for the SQL Server Schema Compare to show the correct comparison? Something in the comparison settings?

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • You said "If I do go ahead with the update to add a table to the project, E.G. Exhibit table, then it appears as Exhibit_1.sql in the project alongside the existing Exhibit.sql" - did you have a look inside the generated file to see if there are any differences in scripts between Exhibit.sql and Exhibit_1.sql? To clarify my question: I suspect that the comparer may not like something about existing files, either some keywords being used or perhaps file collation. – Alex Mar 19 '21 at 01:07

0 Answers0