SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Files open in a new SSMS instance


SQL Files open in a new SSMS instance

Author
Message
Chad Crawford
 Chad Crawford
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4425 Visits: 18732
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
Jerry Hung
Jerry Hung
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3550 Visits: 1208
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
Chad Crawford
 Chad Crawford
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4425 Visits: 18732
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
don.schaeffer
don.schaeffer
Old Hand
Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)Old Hand (317 reputation)

Group: General Forum Members
Points: 317 Visits: 1062
Have you found a solution to this issue?
Chad Crawford
 Chad Crawford
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4425 Visits: 18732
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. :-P

Chad
David Data
David Data
SSC Eights!
SSC Eights! (877 reputation)SSC Eights! (877 reputation)SSC Eights! (877 reputation)SSC Eights! (877 reputation)SSC Eights! (877 reputation)SSC Eights! (877 reputation)SSC Eights! (877 reputation)SSC Eights! (877 reputation)

Group: General Forum Members
Points: 877 Visits: 828
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.
LSmulders
LSmulders
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 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
Stefan_G
Stefan_G
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1357 Visits: 961
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"
John Gundrum
John Gundrum
SSC-Enthusiastic
SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)SSC-Enthusiastic (162 reputation)

Group: General Forum Members
Points: 162 Visits: 50
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?



Bill Talada
Bill Talada
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2991 Visits: 2130
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search