Using Visual Studio to Open SQL Files in Management Studio

Within Visual Studio, whether it be through a SQL Server Database project or the TFS Source Control Explorer, you have the ability to open .SQL files. By default, these files will open within Visual Studio, which I’ve found to be less than ideal.  Instead, I typically want these to open as tabs within Management Studio. You can try the View With option and using ssms.exe as your program of choice, but regardless of what arguments to pass in, multiple .SQL files will open a dedicated application instance of Management Studio.

A simple workaround for this is to use explorer.exe, instead. As long as your Windows file explorer uses Management Studio as the default application to open .SQL files, this will allow you to open these files as tabs within a single application instance of Management Studio.  Just remember to make this your default in Visual Studio and it will do this every time.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s