SQL Script Compare no longer receives updates. All its features, and all new development, now live in SQL Script Toolkit (JohanselSantos.sql-script-toolkit), which also includes the former SQL Script Generator, Windows Authentication and more.
How to migrate
Install SQL Script Toolkit (search for JohanselSantos.sql-script-toolkit in the Extensions view).
Uninstall SQL Script Compare (recommended, to avoid duplicated commands and conflicting shortcuts).
Re-apply your custom settings with the new names (the old sqlScriptCompare.* settings are not read by the Toolkit):
Prefer the old Ctrl+K? Enable sqlScriptToolkit.useLegacyShortcuts in the Toolkit.
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.
1.1.2
Fixed an issue where views with very long scripts were being truncated.
1.1.3
Fixed
Fixed TypeError: promptForConnection is not a function after the MSSQL extension update (v1.46.0).
Changed
Connection profiles are now read directly from the mssql.connections setting and listed alphabetically by name.
Passwords are stored securely in VS Code's SecretStorage and reused across sessions. If a login fails, the saved password is cleared and you are prompted again.
The extension still uses the MSSQL extension API when available and falls back to its own connection flow otherwise.
1.2.0
Deprecated: this extension is replaced by SQL Script Toolkit (JohanselSantos.sql-script-toolkit). Added an in-editor notice to install the Toolkit and uninstall this extension. No functional changes.
1.2.1
Deprecated: Display name updated to mark the extension as deprecated. No functional changes.