ssmsssms-21

Open .sql files in SSMS 21 with double click


After upgrading to SSMS 21, whenever I double-click a .sql file, it opens in a new instance of SSMS instead of using the one that's already running.

I've seen several posts about this issue on older versions of SSMS, where people resolved it by editing the registry, but those solutions don't seem to apply to version 21.

Has anyone else encountered this issue and found a working fix?

I understand that SSMS is designed to mainly open solutions/projects, but in my case, I mostly open .sql files directly to run quick queries against a database, so this behavior is quite inconvenient.


Solution

  • I found a workaround.

    First go to HKEY_CLASSES_ROOT\.sql\OpenWithProgids registry key. There is string value started with SSMS.sql. eg. "SSMS.sql.e723483f" is my case.

    enter image description here

    Then go to the key HKEY_CLASSES_ROOT\<value>\shell\Open\ddeexec\Application where <value> corresponds to the string value from the previous key (in my case. HKEY_CLASSES_ROOT\SSMS.sql.e723483f\shell\Open\ddeexec\Application).

    There change (Default) string value from "SSMS.21.1" to "SSMS.21.0".