
The results of the execution can be reviewed under the Messages panel, to see whether it was successful or not:Īdditionally, results can be exported with a click on the Results as button, in the top of the generated script query window, and user can choose between Results as Grid, Text, or File: Once everything is set and reviewed, click the Execute button to run the generated SQL script on a target SQL database Here, as it can be seen, the complete execution plan is shown, along with query cost values If needed, the execution plan can be reviewed before updating a target SQL database, with a click on the Display Estimated Execution Plan button in the top-right corner of the newly opened panel, and it will show the Execution plan panel: In this case, the query window name is AdventureWorks2018_: Generate Script – with a click on the Generate script button, a script is generated and shown under the newly opened panel which named is based on the target database name: There are two ways to push changes to a target SQL database:
#Compare databases using dbschema update#
Group results button to show results by action, schema or type:Īfter setting this up, based on the user’s preference, desired objects should be checked before initiating the update target process In the upper Results panel, objects are grouped by action, which can be changed under the The Object Definitions panel that shows the SQL scripts of compared objects from source and target SQL databases The Results panel that contains all compared objects sorted by action for the update process Once the process of comparison is finished, the comparison results will be presented and there are two panels SqlSchemaCompare query window is brought up again and now the Compare buttonĬan be clicked to compare two SQL databases: Once the above-mentioned options are set and the OK button is clicked, the Default selection will be used in this example: Under the Object Types tab, users can select specific object types and their children toĬompare two SQL databases. Various comparisons and synchronization options can be selected to personalize it. Schema Compare Options window will be opened and under the General tab, Once both sides are loaded, data sources will be shown in the SqlSchemaCompare query window andīefore initiating the comparison process, there are options that can be set with a click on the

Now, the same process from the step 3) to step 7) needs to be repeated for the Target side in order to set everything to compare two SQL databases The OK button should be clicked in order to load the source data source: Once all information is loaded, the Select Source Schema dialog will be shown again and here Network or Azure list of sources that might already exist, or byĭirectly providing Server Name, Authentication type, andĪfter all information for SQL Server and database are entered, click the Connect button: History – in which all previous connections can be seen and selected:īrowse – in which a new connection can be set via Local, This will bring the new Connect dialog in which there are two tabs: The Select Source Schema dialog will be shown and in it, by default, theĭatabase option is selected and under it, click the Select Connection button: Note: If there were some previous SQL Server database schema comparisons, data sources will be shown in this Select source drop-down list and click on the Select Source In the upper left corner of the SqlSchemaCompare query window, locate the


To select source and target from their corresponding drop-down lists: This will load the SqlSchemaCompare query window and the first thing that needs to be done is To compare two SQL databases with Visual Studio’s Schema Compare feature, follow these steps:įrom the main menu, go to the Tools -> SQL Server sub-menu -> On which additional testing should be done before moving to production. This is a neat feature, as it facilitates work for developers who are working on database development and need a quick way to synchronize the latest changes with the QA database, Among these features, Visual Studio offers users the feature to compare two SQLĭatabases via its Schema compare feature.īesides comparing SQL Server database locally or on the network, Visual Studio can connect and compare Azure SQLĭatabase as well. Visual Studio is an application that is used by many developers and it has different kinds of features that can facilitate the developer’s work.
