I'm using Visual Studio 2008 and SQL Server 2008. I would like .sql files in my VS projects to open in SQL Management Studio by default. No problem so far: I right-click the file, Open With, Add SSMS, and set it as the default. What I don't like is that it opens a new instance of SSMS every time, and I would like it to open in an existing instance if there is one.
I noticed that the Open command associated with .sql files in Windows (which has the behavior I want) calls ssms.exe with the /dde switch. Not exactly sure what switch does, but I played around with it and it doesn't seem to have anything to do with opening files in an existing instance.
Any idea how I can get this behavior to work from within Visual Studio?
Thanks in advance!
Right click the .sql file within Visual Studio, then click "open with", then click "add..." in "Open with" dialog. In the "add program" dialog type "explorer.exe" into the program name field and somehting into "firendly name" field e.g. "with explorer", then click ok. Then select "with exlorer" in "Open with" dialog and click "set as default". Now VS will open .sql files with explorer wich will in its turn call SSMS.
Normally if you open 2 different .sql fiels in explorer you get them in a single SSMS window. If it still opens 2 ssms windows, you need to correct the registry (HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\Command, replace /dde with %1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With