none
How to open multiple .sql files in only one ssms instance

    Question

  • I'm pretty sure this almost equal to some question I already read here but did not solved my problem.

    Here we go... I'm currently working on a Windows Server 2008 R2 with SQL Server 2008 and SQL Server Management Studio istalled.

    When working in Visual Studio with database solution with lot of .sql files I used to double-click on the .sql files and they were opened in the same SSMS instance (if any already opened). Due to a OS error I formatted and reconfigured everything again but now I'm getting a new SSMS instance when double clicking in each sql file. Its really painful one .sql - one SSMS instance so I started my research about that.

    What I've tried till now:

    1) Right click on the .sql file > "Open With" option > "Add" option > "Program Name: C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" and "Friendly Name: SQL" > "Ok" > "Set as Default". Does NOT work. Still having one sql - one ssms instance.

    2) Perfomed Run > regedit > and modify the value data of HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\Command  and replace /dde with "%1". DOES NOT WORK

    3) Right click on the .sql file > "Open With" option > "Add" option > "Programe Name: explorer.exe" and "Friendly Name: Explorer" > "Ok" > "Set as default". Does NOT work. When double-clicking on the .sql files Notepad comes with scripts content.

    4) Some pages like this

    http://social.msdn.microsoft.com/Forums/en/sqltools/thread/ac2f39c5-66e5-495c-b7a6-47e743853baf

    asks to change file association but when opening Windows Explorer > Tools > Folder Options ... I found there is no "File Type" tab. How annoying!

    Can someone help me on that? My patient it's really running out.

    Thanks in advance

    Thursday, November 11, 2010 8:05 PM

Answers

  • I just tested it with SQL Server 2008. They open in the same SSMS instance. I did not do anything extra beside uneventful install on Windows 7.

     


    Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM
    Friday, November 12, 2010 4:48 PM
    Answerer
  • Same with me, tested with SSMS 2005 + SSMS 2008 under Win XP, Vista and Windows 2003 Server. And I don't know any option how to change this behavior.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Friday, November 12, 2010 5:23 PM
  • 4) Some pages like this

    http://social.msdn.microsoft.com/Forums/en/sqltools/thread/ac2f39c5-66e5-495c-b7a6-47e743853baf

    asks to change file association but when opening Windows Explorer > Tools > Folder Options ... I found there is no "File Type" tab. How annoying!

    File association in Windows Server 2008 could be found by going to Start > Control Panel > Default Programs > Associate a file type or protocol with a program. In the file association list find out .sql, click on Change Program and select "SSMS - SQL Server Management Studio" (C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe.

    This option did the trick in my case. Hope it helps somebody else too.

    (P.S.: Thanks God, I was really going so crazy with lot of SSMS instances running!!! )

     

     

    • Marked as answer by George_21 Friday, December 03, 2010 6:47 PM
    Friday, December 03, 2010 6:46 PM

All replies

  • Hello,

    Please see the following thread:

    http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/aa2785db-49b5-4ed6-8430-e7403cd686fb

    Hope this helps.   
     
    Regards,

    Alberto Morillo
    SQLCoffee.com

    Friday, November 12, 2010 2:55 AM
    Moderator
  • Hello,

    Please see the following thread:

    http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/aa2785db-49b5-4ed6-8430-e7403cd686fb

    Hope this helps.    
     
    Regards,

    Alberto Morillo
    SQLCoffee.com

    Thanks Alberto but the problem described in the link does not fill my expectatitions. I need to configure either the Visual Studio and the SSMS to open more than one .sql file in the same ssms.exe instance.

    Somebody else having clues?

    Friday, November 12, 2010 11:34 AM
  • I just tested it with SQL Server 2008. They open in the same SSMS instance. I did not do anything extra beside uneventful install on Windows 7.

     


    Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM
    Friday, November 12, 2010 4:48 PM
    Answerer
  • Same with me, tested with SSMS 2005 + SSMS 2008 under Win XP, Vista and Windows 2003 Server. And I don't know any option how to change this behavior.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Friday, November 12, 2010 5:23 PM
  • 4) Some pages like this

    http://social.msdn.microsoft.com/Forums/en/sqltools/thread/ac2f39c5-66e5-495c-b7a6-47e743853baf

    asks to change file association but when opening Windows Explorer > Tools > Folder Options ... I found there is no "File Type" tab. How annoying!

    File association in Windows Server 2008 could be found by going to Start > Control Panel > Default Programs > Associate a file type or protocol with a program. In the file association list find out .sql, click on Change Program and select "SSMS - SQL Server Management Studio" (C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe.

    This option did the trick in my case. Hope it helps somebody else too.

    (P.S.: Thanks God, I was really going so crazy with lot of SSMS instances running!!! )

     

     

    • Marked as answer by George_21 Friday, December 03, 2010 6:47 PM
    Friday, December 03, 2010 6:46 PM
  • Although its an old post, if someone is still looking for solution, here is one:

    I was having the same issue with Visual Studio 2012; my default editor for PHP files. Whenever I tried opening files from filezilla (an FTP client), it opened a new instance. I solved this problem by suplying /Edit  command line switch

    php "C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv" /Edit

    (e.g. from start(menu), run, cmd or posh you can do, "C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv" /Edit "c:\php\www\ActAsMiddleTier\dotnet_serializer.ashx.php")

    For more information, checkout the list of command line switches for devenv. Also, read the comments for tricks and tips.


    - a citizen of Microsoft Developer Network.

    • Proposed as answer by Naomi NEditor Friday, March 29, 2013 6:17 PM
    • Edited by Real McCoy Friday, March 29, 2013 7:12 PM
    Friday, March 29, 2013 5:27 PM