Thank this author by sharing:
By Lynn Collins,
I am running SQL Server Management Studio 2005 on a Windows 7 machine here at work. I am not sure when this started happening, but when I double-click a .sql file in Explorer, SQL Server Management Studio (SSMS) would open, but would not load the file in question. It would also not bring up a logon screen to connect to an instance. I tried unassociating the .SQL extension and then re-associating it using "Open With" SQL Server Management Studio, but it never worked. I made suggested registry modifications; uninstalled and reinstalled SSMS, but nothing would resolve the issue. Then "duh"....I looked at the SSMS Tools menu. To my surprise, the "File Extension" window was empty!
Surprisingly, I haven't been able to find this solution ANYWHERE, even in Microsoft SQL Help Solutions. Microsoft, and almost every other site, refers to modifying the "HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\Command" to fix this issue. Even after uninstalling/installing SSMS, I was never able to find this Registry Key.
I hope this solution helps, and here is what I did.
Now close SSMS and double-click on a .sql file. Your script should now open in SSMS Query Window.
Clearing Server name in SQL Management Studio
SQL Server Management Studio - validade database button
Microsoft SQL Server Management Studio Question
After quite a few versions, Enterprise Manager is being retired. SQL Server 2005 will have a new man...
Sql Server Management Studio Bahaving WIERD