none
sql files opening in new ssms instance RRS feed

  • Question

  • Hi all,

    I have recently upgraded my SSMS to 2017 version , after upgrading the management studio- whenever i  double click on a .sql file it is opening in a new instance of SSMS (i.e not in a new tab of already opened SSMS), could anyone please let me know if they have faced same issue and how to fix this?

    • Changed type Jingyang Li Tuesday, June 12, 2018 8:15 PM
    • Moved by Tom Phillips Tuesday, May 7, 2019 1:59 PM SSMS question
    Tuesday, June 12, 2018 7:40 PM

All replies

  • Sorry, I am not experiencing the same issue. Double-clicking on a .sql file opens in a new tab for me. I wonder if there's an option for it...
    Tuesday, June 12, 2018 7:44 PM
  • May be you have more than one SSMS versions installed and also are you sure its another instance of 2017 or older version?

    If its older version ( or different version than the one already opened) check this ,http://www.sqlservercentral.com/blogs/steve_jones/2016/08/11/opening-sql-files-in-ssms-2016-by-default-sqlnewblogger/


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Tuesday, June 12, 2018 7:48 PM
  • The above link path is available if you are using Windows 8 and above.

    If its windows 7, go to Control Panel\Programs\Default Programs\Set Associations

    Scroll down and chose .sql and select Change Program on right top and it will give options to chose. 


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Tuesday, June 12, 2018 7:56 PM
  • Its opening another instance of SSMS 2017 and i have made the changes to associate .sql files to SSMS but no luck
    Tuesday, June 12, 2018 8:30 PM
  • Its opening another instance of SSMS 2017 and i have made the changes to associate .sql files to SSMS but no luck

    Can you do this:

    1. Go to HKEY_CLASSES_ROOT\ssms.sql.9.0\Shell\Open\Command
    2. Edit the (Default) value
    3. It should contain something like this: "c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\ssms.exe" /dde
    4. Add "%1" to the end
    5. The final value will be something like this: "c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\ssms.exe" /dde "%1"

    This link also talks about a similar issue.

    Hope this helps!


    Please remember to click "Mark as Answer" if my response answered your question or click "Vote as helpful" if it helped you in any way.

    Tuesday, June 12, 2018 9:11 PM
  • Hi,

    Please refer to following relevant threads, see if they work for you:

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/fadd5af4-4a9d-46c3-8c1f-0418e867e1f8/double-click-sql-files-open-2nd-instance-of-ssms-2012?forum=sqltools

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8fed6d0e-813f-4dbc-8add-dbc01ad015c1/how-to-open-multiple-sql-files-in-only-one-ssms-instance?forum=sqltools

    Thanks,
    Xi Jin.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 13, 2018 5:59 AM
    Moderator
  • This behavior occurred for me after another program stole the .sql associations, and I tried to reassociate it with SSMS.  Something went wrong and it never worked after that.

    I tried to repair using add/remove programs but it errored.  Then I downloaded the installer and used that to do a repair.  The next time I ran a .sql file it prompted me again to choose, and I chose SSMS, and it has worked since then.

    Note that in the registry there are people out there telling you to add "%1" to Computer\HKEY_CLASSES_ROOT\ssms.sql.14.0\Shell\Open\Command\Default.  Don't do it!  The /dde is all that is required.  This was restored after I repaired my install.  It should look like this:

    "C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.exe" /dde

    Finally, I noticed that the icon chosen for .sql files is back to a small picture of a sql query with a cylinder in the lower left.  After I had manually reassociated with SSMS it had changed to the SSMS icon (yellow cylinder in the upper left with a wrench in the lower right).

    I hope this helps someone.

    Tuesday, April 9, 2019 8:24 PM
  • I had the exact problem, after installing SSMS 18.

    Look inside the registry (HKCR=HKEY_CLasses_Root)

    HKCR\.sql\Default, (mine says) sql_auto_file

    I find that  HKCR\sql_auto_file\shell\open\ddeexec\application\Default = ssms.11.0 (a)

    Have a look at HKCU\Software\Microsoft\SQL Server Management Studio\18.0_IsoShell_Config and find that DDEApplication = ssms.15.0

    Change the value at (a) to ssms.15.0 et voila

    I also changed a couple of other entries such as HKCR\Applications\Ssms.exe\shell\open\ddeexec\Application\Default (search for ssms.11.0 and decide for yourself if it needs changing or not)


    Tuesday, May 7, 2019 1:51 PM
  • Floowing this article : 

    • https://pietervanhove.azurewebsites.net/?p=2321

    Steps to fix: on Win 10 x64 - SSMS v18.3.1 (15.0) : 

    1)  GO TO:  HKEY_CLASSES_ROOT\ssms.sql.15.0 (might have different version should work as well ) change (Default) registry from : 
    "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe" /dde
    TO : "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe" "%1" /dde
    2) GO TO: HKEY_CLASSES_ROOT\.sql change reg data from .sql_auto_file to ssms.sql.15.0 - refresh the registry and exit.
    3) Press Win button type Default Apps -> Choose default apps by file type -> .sql (change it to notepad, then opened in Explorer a single .sql file via notepad, after that changed .sql file to SSMS) 
    When that worked for me there was a slight change on how .sql files appear (they used to be in some new fancy look, now reverted to previous look). 

    Hope this helps someone.


    • Edited by Komshiqta Tuesday, November 5, 2019 2:23 PM
    Tuesday, November 5, 2019 2:22 PM
  • Thank You,

    It Worked For me

    Tuesday, November 26, 2019 10:51 AM