Apparently this is a known Win10 bug and should hopefully be fixed in an upcoming update.
I have installed SQL Server Management Studio v17.9 on a clean Windows 10 installation. This associated all
.sql files with SSMS.
I want to associate
.sql files with a plain text editor (eg: Sublime) but I am unable to change the default application. I have tried:
- Right click
.sqlfile -> Open With -> Sublime + "Always use this program".
- Settings -> Default Applications by File Type -> Find
.sql-> Change to Sublime
- Right click
.sqlfile -> Properties -> "Change" button -> Sublime.
ftypevia elevated command prompt as seen here
In all 3 cases, my selection is not reflected in any way, anywhere. The icon remains SSMS, and the file opens with SSMS.
Is there some kind of "File Association retention" setting within SSMS I am unaware of?
Edit: I can change the default application for non-SSMS-associated extensions without issue.
Edit: after deleting registry key
.sql files show a VSCode icon:
If I then double-click
New Users.sql, it opens with SSMS and a refresh of regedit shows the
.sql entry recreated with ssms.exe associated (the icon remains VSCode):
If I then right-click -> open with -> Choose Another App -> Select Sublime and hit "Always use this to open .sql files", it opens with Sublime and a refresh of regedit shows a new "b" entry created for Sublime. The icon remains VSCode, and double-clicking opens it in SSMS:
If I then delete the
a entry for
ssms.exe and rename
a such that only sublime exists, then double-click the .sql file, it opens with SSMS and generates a new
b entry for itself: