Answered by:
Opening sql files opens new instance of SQL Management Studio

Question
-
Hi Folks,
I'm sure this has been answered before but all my searches for this problem don't find what I need. It's a quirk but driving me nuts.
If I have sql management studio open and I view a sql file from Vault, or double-click it in explorer, it always opens a new instance of mgmt studio. I open 5 sql files, 5 instances of mgmt studio.
How do I tell my system to reuse mgmt studio to open sql files if it's open?
Thanks in Advance,
-David
Wednesday, March 7, 2007 9:48 PM
Answers
-
I was having this same issue - (but my co-workers were not). It is an issue with the file association. I was able to fix it by restoring the default by going to:
Windows Explorer; Tools; Folder Options; File Types (tab); then select .sql extension. Mine did not have an advanced button like many of the other extensions, but rather a "RESTORE" button in it's place. Apparently I kept looking right past the solution. I kept wondering why .sql did not have an ADVANCED button. Once I clicked RESTORE, all is good. Now the ADVANCED button shows also instead of the RESTORE.
Dave- Proposed as answer by David Wanta Thursday, November 19, 2009 3:36 PM
- Marked as answer by Kalman TothEditor Friday, November 20, 2009 8:04 PM
Tuesday, November 17, 2009 7:54 PM
All replies
-
What version of SQL Server Management Studio do you have?
9.00.1399 = RTM
9.00.2047 = SP1
9.00.3042 = SP2Paul A. Mestemaker II
Program Manager
Microsoft SQL Server Manageability
http://blogs.msdn.com/sqlrem/Thursday, March 8, 2007 4:09 AM -
Thursday, December 11, 2008 5:13 PM
-
Hello,
I have done a little try:
i have searched a 1st file with the extension .txt , double-click on it => the file is open in a 1st notepad window
i have searched a 2nd file with the extension .txt, double-click on it => the file is open in a 2nd notepad window
it is because the extension .txt is associated with the program notepad.exe
if you do the same thing with 2 files having the extension .sql, you will obtain 2 instances of ssms
it is because during the install of Sql Server, .sql is open thru Sql Server Management Studio on default
2 solutions :
- you don't double-click on a .sql file
- you suppress the association .sql <=> SSMS
for that :
click on start
click on config panel
click on folders oprions
click on the tab files types ( the 3rd one )
find the extension SQL
click on advanced
and unckech the checkbox : open with this program ( the hightlighted one )
and click on OK
I advice you to choose the 1st solution ( i am not sure that at the 1st update of Sql Server , the association will not be created )
You are facing to the way of the double-click is treated by Windows
Have a nice day
Please remember to click 'Mark as Answer' on the post that helped you. Unmark if it provides no helpFriday, December 12, 2008 8:24 PM -
You could drag and drop the file into studio manager also
John K. Knowledgy Solutions http://knowledgy.org/Sunday, December 14, 2008 8:19 PM -
I was having this same issue - (but my co-workers were not). It is an issue with the file association. I was able to fix it by restoring the default by going to:
Windows Explorer; Tools; Folder Options; File Types (tab); then select .sql extension. Mine did not have an advanced button like many of the other extensions, but rather a "RESTORE" button in it's place. Apparently I kept looking right past the solution. I kept wondering why .sql did not have an ADVANCED button. Once I clicked RESTORE, all is good. Now the ADVANCED button shows also instead of the RESTORE.
Dave- Proposed as answer by David Wanta Thursday, November 19, 2009 3:36 PM
- Marked as answer by Kalman TothEditor Friday, November 20, 2009 8:04 PM
Tuesday, November 17, 2009 7:54 PM -
This didn't work for me. Hitting restore set it back to opening with Visual Studio. But I want it to open with SSMS.
- Proposed as answer by BAInnes Monday, February 8, 2010 8:45 PM
Sunday, January 24, 2010 6:19 PM -
I had the same problem. I used to be able to open files with the .SQL extension into a single instance of SQL Server management studio. My previous hard-drive failed, and when I reloaded the new one, I must have changed the order in which I installed Visual Studio and MSSQL, because VS became the new default application for SQL files. I tried changing the file association to SQLWB.exe, but that gave me the multiple instance problem. Hitting "Default" only changed the file association back to VS. After a little trial and error, I believe I have the solution:
Delete the existing file type association for SQL.Click “New” and enter SQL for the File Extension, then click “OK.”
The new file association should show at the top of your list, and the details should show in the frame below.
Click on “Advanced”.
To change the icon, click on the “Change Icon” button and browse to "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe" (if SQL Server is located on a different drive, adjust the path accordingly.)
Select the icon of your choice, and click “OK”.
Click the “Edit” button, fill in the page with the values below, then click “OK”:
Application used…: "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe" /dde "%1"
Use DDE: Checked
DDE Message: Open("%1")
Application: sqlwb.9.0
Topic: system
Click “OK” to save the changes, and “Close” to exit “Folder Options.”
- Edited by BAInnes Monday, February 8, 2010 9:17 PM Missing command-line parameter
Monday, February 8, 2010 8:53 PM -
I have the same problem with double-clicking a .sql file opening a new window each time.
I can't figure out how to do any of the above solutions in Windows 7. Could anyone help me out here?
Thursday, November 25, 2010 2:20 PM -
I have the same issue as above. The order of installation of Visual studio and SQL Server Management Studio seems to be the cause. Whilst I now can open my files in SQL Server Management Studio, I still have the rather annoying prompt to connect to Database Engine. It used to use the current database connection but now any files dragged onto the query window automatically prompt me to connect. Any ideas?Tuesday, December 21, 2010 9:12 AM
-
Hello MarkStevo,
Please, could you have a look on these links ?
I think they should help you
Have a nice day
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.Tuesday, December 21, 2010 10:30 AM -
This DOES NOT WORK in windows 10. What do i do? Any Ideas?Wednesday, August 19, 2015 1:16 AM