SQL files open new SSMS instance

I know there is already a thread on this but it is old. When ever I double click on a .sql file it opens a new instance of SSMS. This is annoying and not the behavior that I'd expect. When the new instance opens the file will be there BUT I get an error message, "There was a problem sending the command to the program."

I'm running SQL Server 2012 SP1 on Windows 7. Does anybody have a modern fix for this issue?


  • Edited by falcon00 Wednesday, May 21, 2014 4:47 PM
May 21st, 2014 4:47pm

Hello,

Please try the below procedure, but first backup the registry.

Run regedit and go to the following key:


HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ssms.sql.11.0\Shell\Open\Command


Edit the default value to add "%1" to the end.


The value should now look like the following:

"c:\Program Files\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\ssms.exe" /dde "%1"



Hope this helps.

Regards,

Alberto Morillo
SQLCoffee.com

  • Proposed as answer by Naomi NEditor Wednesday, May 21, 2014 5:19 PM
  • Unproposed as answer by falcon00 Wednesday, May 21, 2014 7:15 PM
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2014 5:10pm

No dice. Do I need to reboot my machine?
May 21st, 2014 5:18pm

You may try to re-boot.

BTW, I was trying to find a way to fix that File Association directly in Windows 7 and it seems we need to use a free utility for that

http://www.thewindowsclub.com/change-file-associations-windows

BTW, for me it works fine (doesn't open a new SSMS instance).

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2014 5:21pm

OK. I'm in the middle of something. Let me try rebooting in a bit.
May 21st, 2014 5:27pm

No dice.
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2014 6:46pm

Can you verify if that registry entry stick? Also, did you check the link I posted? I think you should be able to fix the file associations this way, but it seems to require a freeware utility. I haven't downloaded it, so I haven't verified. You may want to try it.
May 21st, 2014 6:56pm

The registry entry did stick after the reboot. I downloaded that utility and it wasn't helpful. The file is associated properly. The icon shows it as a sql file and all the windows tools show ssms as the default program. It just refuses to open in an existing instance and without throwing an error.
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2014 7:14pm

What is the cmd Shell command to open .sql files? Without that utility I was not able to find out my own command, but I think last parameter should be '% 1' meaning open in the same instance.
May 21st, 2014 7:49pm

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

that's what it looks like. The only difference from above is that it's (x86) instead of just Program Files.

Free Windows Admin Tool Kit Click here and download it now
May 21st, 2014 8:04pm

Hi falcon,

According to your description and error message, there is an feedback to Microsoft such this similar issue. For more information, see: http://www.beta.microsoft.com/SQLServer/feedback/details/705728/ssms-doenst-launch-when-dclick-on-sql-file.

However, it was closed as they could not reproduce.  I would recommend to submit this feedback again to the Microsoft Connect at this link https://connect.microsoft.com/SQLServer/Feedback, and descript more detail  about for your scenario to help us to reproduce the issue. Your feedback enables Microsoft to offer the best software and deliver superior services, meanwhile you can learn more about and contribute to the exciting projects on Microsoft Connect.

Thanks,

Sofiya Li

May 22nd, 2014 7:36am

BTW, in my case the command is just

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

E.g. no % 1 at the end. It still works OK for me and opens the sql file in the existing instance of SSMS.

Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2014 3:06pm

BTW, Sofiya, I am getting the exact same issue often when I don't have SQL Server opened and try to double click on the .sql file the first time.

Wondering if the existing issue can be re-opened instead of creating a ne

May 22nd, 2014 3:08pm

"c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\ssms.exe" /dde is what mine looked like originally. After a day of googling I'm convinced there is no solution to this issue because nobody understands the cause. There is probably something obscure wrong with my machine and the only fix is to reimage the HD. :(
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2014 3:14pm

Would it be possible to open a case with MS?
May 22nd, 2014 3:22pm

I will this weekend.
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2014 3:24pm

Did you open a case with MS, I know this is an old thread but did you find any resolution I am working with SS 2014.
April 24th, 2015 8:52am

No I never did find any resolution.

  • Edited by falcon00 15 hours 15 minutes ago
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 11:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics