I am DBA with a brand new server box running Home windows Server 2008 Enterprise SP1 with SQL Server 2008 and SQL Server Management Studio.

During my previous box when employed in Visual Studio with database solution with large amount of .sql files I did previously double-click the .sql files plus they were opened up within the same SSMS instance (if any already opened up). However (even if getting the identical installation within the new box) I am now obtaining a new SSMS instance when double clicking in every sql file. Its really painful one .sql Body SSMS instance and so i began my research about this.

What I have attempted till now:

1) Right click the .sql file > "Open With" option > "Add" option > "Program Title: C:Program FilesMicrosoft SQL Server100ToolsBinnVSShellCommon7IDESsms.exe" and "Friendly Title: SQL" > "Ok" > "Set as Default". Doesn't work. Still getting one sql Body ssms instance.

2) Perfomed Run > regedit > and customize the value data of HKEY_CLASSES_ROOTsqlwb.sql.9.0ShellOpenCommand and replace /dde with "%1". Doesn't Work

3) Right click the .sql file > "Open With" option > "Add" option > "Programe Title: explorer.exe" and "Friendly Title: Explorer" > "Ok" > "Set as default". Doesn't work. When double-hitting the .sql files Notepad includes scripts content.

4) Some pages such as this

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

asks to alter file association however when opening Home windows Explorer > Tools > Folder Options ... I discovered there's no "File Type" tab. How annoying!

Can someone assist me to on that? My patient it is drained.

Thanks ahead of time

Similar issues happen to be reported multiple occasions, however they aren't addressing the problem:

http://connect.microsoft.com/VisualStudio/feedback/details/105575/multiple-instances-of-sqlwb-exe-when-management-studio-set-as-default-editor

http://connect.microsoft.com/SQLServer/feedback/details/622181/multiple-ssms-open-for-seperate-sql-files

http://connect.microsoft.com/SQLServer/feedback/details/680761/a-new-instance-of-ssms-is-opened-when-trying-to-open-a-tsql-file-even-when-an-instance-is-running

Have you install Visual Studio (or any Visual Studio components) after setting up SQL Server?

My prediction would be that the Connect products won't be fixed - SQL will blame Visual Studio, Visual Studio will blame SQL, and also the products will stay open...

So here's what I would recommend: operate a repair of SQL Server from Programs featuring after which re-apply the most recent service pack of SQL Server 2008 (SP2).

Even the "File Types" interface was moved in the Tools / Folder Options interface towards the User Interface. Get into User Interface > Default Programs > "Connect personal files type or protocol having a program." Nevertheless it does not appear to achieve the options here to include command-line options like "%1" or /dde.

Try adding these reg secrets too, but make certain you place the /dde in:

[HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\ddeexec]
@="Open(\"%1\")"

For that record, here's my entire export for your section:

[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"