2
0
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
.sql
file -> Open With -> Sublime + "Always use this program". - Settings -> Default Applications by File Type -> Find
.sql
-> Change to Sublime - Right click
.sql
file -> Properties -> "Change" button -> Sublime. - Using
ftype
via 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 HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.sql
, .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 b
-> a
such that only sublime exists, then double-click the .sql file, it opens with SSMS and generates a new b
entry for itself:
What are the contents of the registry key
– harrymc – 2018-11-09T09:16:31.797HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.sql\OpenWithList
? Do they change when you associate the files with Sublime or are they somehow locked? If they seem locked, right-click the key, choose Permissions and add a screenshot. Note this.Deleting that key from registry,
.sql
files show VSCode icon. Double-clicking file opens it in SSMS and creates new.sql
registry entry withssms.exe
. Open with -> anything adds new key "b", "c" etc in the OpenWithList. – Alex McMillan – 2018-11-10T04:58:04.540If you are running Windows 10 1803 or 1809 this is a known confirmed bug. It’s also going to be fixed by the end of November. There really isn’t a work around at this time. All you can do is wait for the cumulative patch that fixes it. – Ramhound – 2018-11-10T05:32:05.433
@Ramhound yeah I'm running 1803. Do you have any links you could share in an answer for me to accept? – Alex McMillan – 2018-11-10T05:38:40.543
@AlexMcMillan - You want a link that confirms this is a bug? – Ramhound – 2018-11-10T05:39:24.917
1@AlexMcMillan There are about 12 duplicates here at SuperUser. Granted all with commentary from myself indicating it’s a bug. – Ramhound – 2018-11-10T05:56:44.490
1@xakepp35 - Sounds like a perfect reason to submit your own question since you are running Windows 7. Microsoft has not been hacked. – Ramhound – 2018-12-13T01:08:22.940