SQL Script Compare is a VS Code extension designed to compare the scripts of a specific object (views, stored procedures, functions, triggers) between two SQL Server databases. It helps database administrators and developers quickly identify differences in schema, indexes, constraints, and other dat
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
SQL Script Compare is a Visual Studio Code extension designed to compare SQL scripts between two SQL Server databases. This extension helps database administrators and developers quickly identify differences in schema, objects such as views, stored procedures, functions, triggers, indexes, constraints, and other database structures.
Features
SQL Script Compare: Easily compare SQL scripts of specific database objects between two SQL Server databases. Ctrl + K.
SQL Script Compare | Refresh Connection: Refreshes the SQL Server connection to ensure you're working with the latest data. Ctrl + Shift + K.
Customizable Settings: Configure the default port, connection cleanup behavior, and inclusion of USE DATABASE statement in generated scripts.
Requirements
You need to have SQL Server installed and accessible.
Install the mssql extension for Visual Studio Code to allow connection to SQL Server databases. Install mssql extension
Extension Settings
sqlScriptGenerator.shortcut: Customize the keyboard shortcut for generating SQL scripts. Default: Ctrl + K.
sqlScriptGenerator.refresh: Use Ctrl + Shift + K to refresh the SQL object list.
sqlScriptGenerator.sqlPort: Set the default SQL Server port in case it's not found in the connection string.
sqlScriptGenerator.includeUseDatabase: Set this to true to automatically include USE DATABASE in generated scripts. Default: true.
Known Issues
Currently, SQL Server Authentication is required to connect to the database server. Windows Authentication is not supported at this time. Please ensure that you select SQL Server Authentication when connecting.
In some cases, when connecting to a local server, users may encounter a database connection error when loading the object scripts. This issue typically arises because the server's network configuration is not properly set up in SQL Server Configuration Manager and the machine does not have port 1433 (default port) open in the firewall. To resolve this:
Ensure that TCP/IP is enabled in SQL Server Configuration Manager under SQL Server Network Configuration.
Verify that port 1433 is properly configured and open in both the server's SQL Server instance and your local firewall.
Release Notes
Users appreciate release notes as you update your extension.
1.0.0
Initial release of the SQL Script Compare extension.
Ability to compare SQL scripts between two SQL Server databases.
Command to refresh the SQL Server connection.
Customizable settings for port, connection cleanup, and inclusion of USE DATABASE.
1.1.0
Title changes to run the extension by pressing F1.
Compare SQL Scripts is now SQL Script Compare
Refresh SQL Connection is now SQL Script Compare | Refresh Connection
1.1.1
Fixed a bug that did not properly reset the connection when the clearConnectionAfterCompare setting was set to true.