Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
432 views
in Technique[技术] by (71.8m points)

sql server - SQL Management Studio won't open scripts on double-click

I'm used to double-clicking *.sql script files to open them in SQL Server Management Studio. I recently upgraded to Win7, and now when I double-click a script file, SSMS opens with an empty environment. I can then use File/Open or File/Recent Files to open my script, but I would much prefer for it to just open whatever I double-clicked on like a normal application would.

Any ideas what's going on?

BTW when I double-click a script from the Solution Explorer in Visual Studio, it does open it automatically just like you would expect.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same problem. I don't know what caused it, but I fixed it with a quick Registry hack.

  1. Go to HKEY_CLASSES_ROOTsqlwb.sql.9.0ShellOpenCommand
  2. Edit the (Default) value
  3. It should contain something like this: "c:Program Files (x86)Microsoft SQL Server100ToolsBinnVSShellCommon7IDEssms.exe" /dde
  4. Add "%1" to the end
  5. The final value will be something like this: "c:Program Files (x86)Microsoft SQL Server100ToolsBinnVSShellCommon7IDEssms.exe" /dde "%1"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...