Dan Abramov
Dan Abramov

Reputation: 268215

Can I disable Query Designer in Visual Studio in favor of plain SQL editor with highlighting?

I hate the standard Query Designer window that comes up when you select New Query on a data connection in Server Explorer. I'd much rather have a T-SQL Editor come up. Is this possible?

Maybe not replace that functionality but a shortcut key or something that would bring up a T-SQL editor?

Upvotes: 2

Views: 4128

Answers (2)

Oleg Grishko
Oleg Grishko

Reputation: 4281

Tools > Options > Database Tools > Query and View Designers > Panes shown by default

Uncheck the Diagram and Criteria (and Results if you want even more clean look)

enter image description here

Upvotes: 9

Dan Abramov
Dan Abramov

Reputation: 268215

I found a workaround, although it does not solve the problem completely:

  1. Open Tools > Customize > Commands
  2. Select Context menu: Other Context Menus | Server Explorer
  3. Remove annoying New Query
  4. Click Add Command...
  5. Locate Data > New Query Connection...
  6. Click OK to add it to Server Explorer context menu

This adds New Query Connection... context menu to all Server Explorer connections (as well as the root Data Connections item):

New Query Connection menu

This will fire up the T-SQL Editor.

The only problem with this workaround is that, invoked this way, T-SQL Editor has no way of knowing which connection was selected so it asks for connection settings again. You will also have to specify the database in the toolbar (easy if you're working with just one).

Although it's not perfect, I find it a better solution that constantly hitting the Query Designer awkwardness.

Upvotes: 4

Related Questions