This is how you can do it in Visual Studio:
First of all, Create a SQL Server Database project:
Then import the database:
In the window that will be opened, configure the connection to the necessary database and press Start to initiate the import process:
After this, you will be able to see folders, subfolders, and definitions of database objects in the project:
In the same way, you will need to create a project and perform import for the second database.
Now, to compare the database schemas, you just need to right-click any of the two projects and then click Schema Compare… in the context menu:
As a result, the database schema comparison window will be opened.
Here you need to select source and target projects and then press Compare to initiate the comparison process:
Here you can configure the source and target for schema comparison:
Table mapping can be configured in the corresponding tab:
“Columns details” displays column definition information from two tables: source database on the left and target database on the right.
This is particularly useful when column names are different in the source and the target.
After schemas are compared, you can select the necessary table and see the table definition differences in two databases:
At the bottom left, the definition code of the source database table is displayed, and that of the target database is displayed at the bottom right.
If needed, a synchronization script for any schema table can be generated.