SQL Files Won't Open Outside of SSMS

  • Hello!  I found some info on the web here:

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f8d65de5-11b5-4792-bb03-b7690f53bb31/sql-file-will-not-open-in-ssms-on-doubleclick-or-jump-list?forum=sqltools

    But the solution I can't do because I can't find the registry entries that the article is talking about.  The first part of course is for SQL 2008 which I know doesn't relate since I have 2014.  But, there is a last entry that talks about 2014... but my registry entries still don't align.
    I can see sqlwep120.sqlwep120 and sqlwep120.sqlwep.120.1 in the HKEY CLASSES ROOT folder but that's it. 

    Does anyone else have this problem?  I can do file open in SSMS to open .sql files but when opening them from a directory or an email, it just opens SSMS and does nothing else.  It won't load the file.  It is super frustrating to have to have every file saved to my hard drive and then open SSMS and log in and everything and then do file open just to get a .sql file.

    Thanks!

  • Do you have any entries like this:

    HKEY_CLASSES_ROOT\ssms.sql.**.*

    with the * being a version number? If so, what do you see under these keys:

    HKEY_CLASSES_ROOT\ssms.sql.14.0\Shell\Open\Command
    HKEY_CLASSES_ROOT\ssms.sql.14.0\Shell\Open\DdeExec

  • Yes:
    I have ssms.sql.12.0
    and then under Shell > Open  I have Command and DdeExec

    Under Command:
    1 entry for REG_SZ and then the path "c:\Program Files (x86)\Microsoft SQL Server .... etc..

    Under DdeExec
    1 entry for REG_SZ that has Open("%1")

  • I was able to break SSMS and cause the behaviour you're seeing but only by altering the HKEY_CLASSES_ROOT\ssms.sql.14.0\Shell\Open\DdeExec registry key. I couldn't trigger this by changing the OpenWith preference in Explorer, but I do remember this being a problem in earlier SSMS versions.

    I am running SSMS 17.8.1 and it seems like whatever this bug is, it may be fixed in the current SSMS. Are you able to upgrade SSMS at all?

    SSMS is now maintained separate from SQL Server and provides better functionality, more frequent updates and backwards compatibility with earlier versions of SQL Server (https://realizeddesign.blogspot.com/2016/04/ssms-separate-tool-from-sql-server.html), so it is worthwhile upgrading just for the better performance and features, but it might also fix your issue.

    P.S. SSMS is free!
    https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017

  • Say what?!?  I can't believe I didn't know that!  I am using the SSMS that was installed from my SQL 2014 package.  I guess I will give that a whirl. 😀

  • Wooo hooo!!!  Downloading the new version fixed the issue... you da best!

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply