21

Is there a way to temporarily suppress SQL Server Management Studio's auto-complete while typing a query? I don't want to disable auto-complete completely just say hold down some key while typing in a particular word so that it doesn't get in the way.

For example say I had the following query

SELECT Foo, Foo2 FROM SomeTable

As I type Foo and then hit space-bar SQL Server Management Studio's auto-complete kicks in and completes Foo to FooBar.

  • 6
    You will find that IntelliSense in SQL Server 2012 Management Studio is much less aggressive. I can't stand it in 2008 - if there is a column named ID it gets changed to IDENT_CURRENT. Puke. – Aaron Bertrand Jun 26 '12 at 20:29
  • 1
    @AaronBertrand - Does hitting space or comma still auto complete? I find that very annoying as I'm used to having to tab for that in other environments and 95% of the time it auto completes to something that I then need to delete the end of. – Martin Smith Jun 26 '12 at 20:34
  • @MartinSmith for space and comma, they are interpreted as they should be, unless you use the down-arrow to highlight the obvious selection (this is one keystroke), then hit space or comma. Tab picks the option SSMS thinks you meant. And the algorithm for "best choice" is 1000X better than 2008/2008 R2. The best part to me is partial match. type sys.depend and the auto-complete list is filtered to all DMVs/catalog views that contain depend. – Aaron Bertrand Jun 26 '12 at 20:39
  • 1
    @MartinSmith This will not help OP, but I think I found a solution in SSMS 2014... posted below. – Doug_Ivison Feb 16 '18 at 16:20
  • 1
    @Doug_Ivison I've posted this question quite a while ago, I'm now using SSMS 2016. I think it's better in this regard now.. – Jack Feb 16 '18 at 17:46
26

Hit ESC to close the window when done typing the word before hitting space, but if you hit ESC after 'fo' and then type 'o' it will kick in again.

Another option if you don't use it often would be to disable it (Tools->Options->Text Editor->Transact-SQL->General->Auto list members) and use CTRL+J to bring it up manually when you want to use it. Red Gate also has a product called SQL Prompt which might offer more control.

In addition there is an "Intellisense Enabled" option under the Query menu and on the Query toolbar if you want to temporarily disable/enable it.

| improve this answer | |
  • 1
    (This also works in other MS tools like VS.) – pst Jun 26 '12 at 20:28
  • Thanks, but its still super annoying for names that contain spaces ([Foo Bar] for example) since as you mentioned it kicks in again so you end up needing to keep hitting ESC. I'm going to leave the question open a bit longer before accepting to see if anyone know of a different solution. – Jack Jun 26 '12 at 20:40
  • I agree, I don't think autocomplete should be enabled in a select clause unless you already have your from tables specified. – Jason Goemaat Jun 27 '12 at 19:05
  • 1
    Ctrl+space (the more common hotkey) also works to bring up auto-complete. – Marc Jan 27 '17 at 9:03
4

If you undo (ctrl-Z) after the wrong auto-selection appears, your original entry will be restored.

| improve this answer | |
2

This will not help with SSMS 2008, but (in case others found this page, like I did), I think I found a solution in SSMS 2014:

Under the Edit pull-down menu, at the bottom, select Intellisense, and then toggle "Complete Word".

This seems to turn off implicit word completion when a space is typed, but I'm still getting the drop-downs offered for completion for columnnames, which can be selected using arrows then return/tab/space.

| improve this answer | |
1

You can turn it off via Auto list members via: Tools->Options->Text Editor->Transact-SQL->General->Auto list members, however this actually causes a bug in SSMS where you get an object null error whenever you hit backspace that repeatedly annoys you.

I find Apex SQL to be quite slow, so I don't use it.

Intellisense is incredibly useful, so I have just decided to put up with the annoyance SSMS auto completing commands whenever I hit [space] or [.] until Microsoft sorts out the above bug.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.