March 5, 2009 at 2:10 pm
When I double click on a .sql file, it starts up SSMS and loads my file. When I click on a second file, I'd like it to open in the SSMS that is currently running. Right now, it's not doing that. Anyone know where I can go to make the change? Thanks!
Thanks,
Chad
March 6, 2009 at 1:41 pm
Any reason why you want to do this? As new SSMS costs more memory than a new tab in existing SSMS
March 6, 2009 at 5:13 pm
Yes, that is what I would like to do - have it open in the SSMS that is already running. Right now it opens a new SSMS everytime I double-click a .sql file and it is much more difficult to manage my open files that way - particularly when they are related in some way. It is much easier to go down a list of tabs than have to ALT-TAB over. I've done some research and found people who have it working that way, I'm not sure why mine isn't... I can get it to work by dragging from Explorer to SSMS, but old habit die hard, and I keep forgetting.
Thanks,
Chad
July 7, 2010 at 2:51 pm
Have you found a solution to this issue?
July 12, 2010 at 8:40 am
No, but I'm getting more accustomed to dragging the file into the window. I guess after doing it for a year it starts to become second nature. If you found something let me know, but I'm almost acclimated and switching now might be difficult. 😛
Chad
July 12, 2010 at 11:10 am
I've had the same problem; I assume it is normal behaviour when starting SSMS that way.
What I do is open SSMS first, and let it connect to the server. Once it's done that, you can double-click on SQL files and they'll all open in separate tabs in the one SSMS instance.
August 5, 2010 at 5:03 am
I had the same problem. What worked for me was to change a certain registry key.
For A solution see:
http://stackoverflow.com/questions/1726577/sql-management-studio-wont-open-scripts-on-double-click
However, instead of replacing /dde by "%1" I just added (a space and) "%1" at the end.
Leo
August 5, 2010 at 6:00 am
Chad Crawford (3/6/2009)
Yes, that is what I would like to do - have it open in the SSMS that is already running. Right now it opens a new SSMS everytime I double-click a .sql file and it is much more difficult to manage my open files that way - particularly when they are related in some way. It is much easier to go down a list of tabs than have to ALT-TAB over. I've done some research and found people who have it working that way, I'm not sure why mine isn't... I can get it to work by dragging from Explorer to SSMS, but old habit die hard, and I keep forgetting.Thanks,
Chad
My system works as you want it to.
What happens when you double-click a file in Explorer is controlled by the following registry keys:
HKEY_CLASSES_ROOT\sqlwb.sql.9.0
HKEY_CLASSES_ROOT\.sql
On my system these keys are configured as follows:
[HKEY_CLASSES_ROOT\.sql]
"PerceivedType"="text"
@="sqlwb.sql.9.0"
[HKEY_CLASSES_ROOT\.sql\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0]
@="Microsoft SQL Server Query File"
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\DefaultIcon]
@="c:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\VSShell\\Common7\\IDE\\ssms.exe,-10000"
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell]
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open]
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\Command]
@="\"c:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\VSShell\\Common7\\IDE\\ssms.exe\" /dde"
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\ddeexec]
@="Open(\"%1\")"
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\ddeexec\application]
@="sqlwb.9.0"
[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\ddeexec\topic]
@="system"
July 8, 2014 at 9:11 am
I am having the same problem with SSMS 2012. Unfortunately, sqlwb.sql.9.0 is not for SSMS 2012 so the above will not work.
Does anyone have a solution for SSMS 2012?
April 3, 2017 at 9:04 am
This works if you associate .sql files with ssms in file explorer.
Right-click a .sql file in a TFS solution and select Open with...
Press Add...
The Program is C:\Windows\explorer.exe
Friendly name is Windows Explorer
Press OK and set as default
April 4, 2017 at 5:56 am
Do you have some screen shots? In TFS Pro 2013 when a .sql file is right-clicked there is no Open With...
April 4, 2017 at 6:57 am
I use VS2015 Pro and a co-worker just confirmed this works in VS2013 also.
Here is the right click to open with:
Here is the Add Program and Set as Default:
April 5, 2017 at 9:35 pm
Finally, something that worked! Thanks!
February 20, 2022 at 9:12 pm
This is a recurring pain for many regardless of the version of SSMS! After struggling with this inconvenience for too long and striking out in Google, I found a solution!
My SSMS was running as Administrator. I turned this off and now opening new Files open in the current running instance of SSMS, and I do not get prompted every time I Launch SSMS!
Right Click the SSMS icon, Properties, Compatibility tab, un-check "Rn as Administrator".
Hope this helps!
February 21, 2022 at 1:19 am
This is a recurring pain for many regardless of the version of SSMS! After struggling with this inconvenience for too long and striking out in Google, I found a solution!
My SSMS was running as Administrator. I turned this off and now opening new Files open in the current running instance of SSMS, and I do not get prompted every time I Launch SSMS!
Right Click the SSMS icon, Properties, Compatibility tab, un-check "Rn as Administrator".
Hope this helps!
What version of SSMS are you using? I ask because I don't see a check box for "Run as Administrator" in any SSMS icon on my system. I'm using the latest SSMS and SQLServer 2016 and 2017 and I don't recall seeing such a thing in 2008 or any other version of SSMS. Yep... there's an entry where I can select to run as administrator but but there's no checkbox.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply