Schema Compare extension
This article provides an overview of the Schema Compare extension for Azure Data Studio. The Schema Compare extension provides an easy-to-use way to compare two database definitions and apply the differences from the source to the target. This includes active database connections, dacpac files, and SQL projects.
It can be tedious to manually manage and synchronize different database versions. The Schema Compare extension simplifies the process of comparing databases and gives you full control when synchronizing them - you can selectively filter specific differences and categories of differences before applying any changes. The Schema Compare extension is a reliable tool that saves you time and code.
Features
The Schema Compare extension provides the following features:
- Compare schemas between two dacpac files, databases, or SQL projects.
- View results as a set of actions to take against the target for it to match the source.
- Selectively exclude actions listed in results.
- Set options that control the scope of the comparison.
- Apply changes directly to the target or generate a script to apply changes at a later time.
- Save the comparison.
Install the extension
To install the Schema Compare extension, follow these steps:
In Azure Data Studio, select the Extensions Icon to view available extensions.
Search for the Schema Compare extension and select it to view its details. Select Install to add the extension.
Once installed, Reload to enable the extension in Azure Data Studio (only required when installing an extension for the first time).
Compare schemas
To compare schemas, open the Schema Compare dialog box. To do so, follow these steps:
To open the Schema Compare dialog box, right-click a database in Object Explorer and select Schema Compare. The database you select is set as the Source database in the comparison.
Select one of the ellipses (...) to change the Source and Target of your Schema Compare and select OK.
To customize your comparison, select the Options button in the toolbar.
Select Compare to view the results of the comparison.
Update an existing SQL project from a database
To update an existing SQL project from a database, follow these steps:
Install both the Schema Compare and SQL Database Project extensions.
From a Database dashboard select the Update Project from Database option in the toolbar.
Select the existing SQL project and the desired file structure for new objects.
Choose View changes in Schema Compare to review the changes before applying them to the SQL project.