2

I realise this is an old chestnut, but does anyone have a definitive solution?

When SSMS (2017) is 'run as administrator', double clicking a SQL file in explorer will open another new instance of SSMS (and not open the file). This is not good. Double clicking a SQL file should open it in the existing open SSMS app.

Is there a solution to this?

What reasons are there to 'run as admin' by default or can this be turned off without impacting functionality?

Many thanks,

James

2
  • 1
    Why not trying opening it not as Admin and see if you have any problems? Commented Feb 6, 2019 at 16:38
  • Internal IT seem to be saying that remote SQL debugging won't work without the raised permissions. I'm not sure this is correct, but in any case it's not working with the raised permissions either. And I don't know anyone who uses SQL debugging in the department as it's never worked properly. But yes, I could get them to lower my permissions and test it.
    – JamesB
    Commented Feb 6, 2019 at 16:43

2 Answers 2

1

In SSMS use Ctrl+O to open the file instead of double-clicking in explorer.

1
  • 1
    Hi Michael, Obviously that is an acceptable workaround, but if you're working with SSMS and SQL files a lot, that soon gets very irritating. Thanks, James
    – JamesB
    Commented Feb 7, 2019 at 9:56
1

Thank you to everyone for your input.

To summarise:

  1. To get double click to work, you cannot be running as administrator. This crosses a security boundary. The primary solution therefore, if possible, is to stop running SSMS with raised permissions.

  2. If for any reason you have to run with raised permissions, double click is never going to work from File Explorer. Use a workaround such as opening the file from SSMS.

We have stopped running SSMS with raised permissions and double click from File Explorer is working fine. I will report back if we hit any problems.

Many thanks,

James

3
  • We found this fixed the issue for some people, but not others. We checked 'run as admin' wasn't set, but still no joy. The gotcha was that there are 2 completely separate 'Run as admin' checkboxes. One under the Advanced button on the Shortcut tab, and one under the Compatibility tab. You need to ensure BOTH are unchecked.
    – JamesB
    Commented Feb 8, 2019 at 10:58
  • This didn't work for me. I checked both the taskbar icon and the one in the Start Menu to ensure that neither of the 'Run as administrator' checkboxes were checked. Still can't seem to find a solution.
    – hacker
    Commented Feb 20, 2019 at 13:53
  • I performed a Repair install on the SSMS 2017 tools and then made the registry change to add %1 to the HCRoot\ssms.sql.14.0\Shell\Open\Command default key. Once that was done, it works. Also the icon is a dark grey/black icon for the SQL files. That was different than previously.
    – hacker
    Commented Feb 20, 2019 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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