Visual Studio - open SQL file using SQL Management Studio in an existing SSMS window?

I use Visual Studio 2008 and SQL Server 2008. I would like the .sql files in my VS projects to open in SQL Management Studio by default. There are no problems so far: I right-clicked the file, Open With, Add SSMS and set it as the default. I do not like that every time he opens a new instance of SSMS, and I would like it to open in an existing instance, if any.

I noticed that the Open command associated with .sql files on Windows (which has the behavior I want) calls ssms.exe with the / dde switch. Not quite sure what the switch does, but I played with it, and it seems to have nothing to do with opening files in an existing instance.

Any idea how I can get this behavior to work in Visual Studio?

Thanks in advance!

+7
sql sql-server visual-studio
source share
3 answers

Right-click the .sql file in Visual Studio, then click "open with," then click "Add ..." in the "Open With" dialog box. In the Add Program dialog box, enter "explorer.exe" in the program name field and enter a value in the "firendly name" field, for example. "with explorer", then click "OK." Then select "with exlorer" in the "Open with" dialog box and click "set as default." Now VS will open the .sql files with Explorer, which in turn will call SSMS.

Usually, if you open 2 different .sql fiels in explorer, you get them in one SSMS window. If it still opens 2 ssms windows, you need to fix the registry (HKEY_CLASSES_ROOT \ sqlwb.sql.9.0 \ Shell \ Open \ Command, replace / dde% 1)

+17
source share

Right-click on C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\ssms.exe file -> Properties -> Go to Compability Tab → Uncheck the box.

Rerun SQL Management Tool.

0
source share

I use SQL Server Management Studio 2012 Express, and I did it to work by pointing the "Program" to "explorer.exe"

Here's how my registry is configured: "C: \ Program Files (x86) \ Microsoft SQL Server \ 110 \ Tools \ Binn \ ManagementStudio \ ssms.exe" / dde

in

HKEY_CLASSES_ROOT \ ssms.sql.11.0 \ Shell \ Open \ Command

folder.

0
source share

All Articles