Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Files open in a new SSMS instance Expand / Collapse
Author
Message
Posted Thursday, March 5, 2009 2:10 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 2,607, Visits: 17,910
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
Post #669665
Posted Friday, March 6, 2009 1:41 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Today @ 8:36 AM
Points: 772, Visits: 1,183
Any reason why you want to do this? As new SSMS costs more memory than a new tab in existing SSMS



SQLServerNewbie

MCITP: Database Administrator SQL Server 2005
Post #670638
Posted Friday, March 6, 2009 5:13 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 2,607, Visits: 17,910
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
Post #670755
Posted Wednesday, July 7, 2010 2:51 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 7:45 AM
Points: 70, Visits: 786
Have you found a solution to this issue?
Post #948851
Posted Monday, July 12, 2010 8:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 2,607, Visits: 17,910
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
Post #950805
Posted Monday, July 12, 2010 11:10 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, July 17, 2014 10:41 AM
Points: 115, Visits: 744
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.
Post #950916
Posted Thursday, August 5, 2010 5:03 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 19, 2014 6:59 AM
Points: 30, Visits: 101
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
Post #964137
Posted Thursday, August 5, 2010 6:00 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, November 26, 2013 8:40 AM
Points: 316, Visits: 908
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"

Post #964173
Posted Tuesday, July 8, 2014 9:11 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, July 17, 2014 9:10 AM
Points: 128, Visits: 39
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?



Post #1590409
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse