When I double click on a .sql file in Source Explorer in VS2012, it opens right there in Visual Studio. How can I get it to open in SQL Server Management Studio instead?
Change the option for sql extensions from within VS.
or right click and change the default action for .sql files.
I misunderstood your question at first.
Go to : Tools >> Options >> Environment >> Tabs and Windows
Then uncheck the "Allow new files to be opened in the preview tab" in the Preview Tab section.
Stack Exchange similar question
You can also right click on the file and select open with. You may have to browse to SSMS which is located below.
Depending on your version of SSMS installed and OS it will be located in one of these folders:
on x64 machine: C:\Program Files (x86)\Microsoft SQL Server{your_version}\Tools\Binn\VSShell\Common7\IDE
on x32 machine:
C:\Program Files\Microsoft SQL Server{your_version}\Tools\Binn\VSShell\Common7\IDE