2

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:

No FileExts entry - 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):

Auto-created entry

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:

Sublime B-entry

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:

Manually removed ssms.exe SSMS auto-entry

  • What are the contents of the registry key HKEY_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. – harrymc Nov 9 '18 at 9:16
  • Deleting that key from registry, .sql files show VSCode icon. Double-clicking file opens it in SSMS and creates new .sql registry entry with ssms.exe. Open with -> anything adds new key "b", "c" etc in the OpenWithList. – Alex McMillan Nov 10 '18 at 4:58
  • If 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 Nov 10 '18 at 5:32
  • 1
    @AlexMcMillan There are about 12 duplicates here at SuperUser. Granted all with commentary from myself indicating it’s a bug. – Ramhound Nov 10 '18 at 5:56
  • 1
    @xakepp35 - Sounds like a perfect reason to submit your own question since you are running Windows 7. Microsoft has not been hacked. – Ramhound Dec 13 '18 at 1:08
4
+50

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.

If you are running Windows 10 1803 or 1809 this is a known confirmed bug. The bug first appeared on PCs running Windows 10 April 2018 Update Build 17134.320 (KB4458469) which was issued on October 9. It also appears on PCs running Windows 10 October 2018 Update Build 17763.55 (KB4464330) which was also issued on October 9th, 2018.

For those machines running the April 2018 Update, Microsoft issued a patch KB4467682, in order to address this issue on November 27th, 2018. For those machines running the October 2018 Update, Microsoft issued a patch KB4469342, in order to address this issue on December 5th, 2018.

Addresses an issue that prevents some users from setting Win32 program defaults for certain app and file type combinations using the Open with… command or Settings > Apps > Default apps.

Source

  • This information took my thinking in a completely different direction; thanks. – Alex McMillan Nov 10 '18 at 5:53
  • 1
    This likely will be resolved with a build equal or greater to 17763.165+ for the October 2018 Update (1809) based on an analysis of when 17134.441 was built compared to when it was released (about 10 days). – Ramhound Nov 27 '18 at 20:09
  • Is there anything I can do right now if my Windows Update decides it's fully updated, KB4469342 decides it's "not applicable" to my computer and KB4467682 isn't in the update catalog for download? – Stoopkid Dec 9 '18 at 22:08
  • 17134.441 was pulled earlier this week. You will have to wait until the next cumulative update is released. KB4469342 is also applicable if you running Windows 10 October 2018 Update (1809), but you are running Windows 10 April 2018 Update (1803), so you will have to wait until the next 1803 cumulative update is released – Ramhound Dec 10 '18 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.