![]() |
|

|
|
By: Aaron Bertrand | Read Comments (10) | Related Tips: More > SQL Server Management Studio |
IntelliSense can be a very powerful ally for the T-SQL developer. It can significantly reduce keystrokes, prevent you from guessing at object names, make sure you spell them correctly (and use the right case), and can help you understand the interface to several programmable entities such as stored procedures and built-in functions. In Management Studio 2012, there are some enhancements to IntelliSense that will make it even more powerful - including more intelligent caching, and partial keyword matching (so you no longer have to remember what letter the waits DMV *starts* with - just type "waits" and it will narrow it down).
I have seen several cases in forums, newsgroups and on twitter where folks complain that IntelliSense is "not working." Now, "not working" can cover a wide variety of things. For the purpose of this tip, we're going to restrict that to not behaving as designed, as opposed to not behaving as desired (for example, if you don't like that pressing the space bar or tab auto-completes for you, that's a different discussion). I thought it would be useful to list out the common symptoms and how you can try to resolve them. Note that most of these items are also applicable to previous versions.
There are a couple of different symptoms that can lead you to believe that IntelliSense is "not working." One is where the IntelliSense features (auto-complete / list members / tool-tips / underlining invalid references) do not function at all. Another is where the completion list appears, but it does not contain the object(s) you're trying to use.
There are several potential reasons why IntelliSense may not be working at all; some are more obvious than others.


...or by checking that the toolbar icon is enabled:


SELECT and FROM, and try to list members using Ctrl+J:
CREATE TABLE dbo.foo ( i INT CHECK (i IN (SELECT <put cursor here> FROM sys.objects)) );
If you copy the SELECT query alone to another query window and try the same experiment, the completion list will appear (unless you are affected by one of the other issues in this tip).
GO before the current line to see if that temporarily resolves the issue, otherwise you will need to go up and fix the other errors. I haven't noticed this to be an issue in SQL Server 2012 - as long as previous statements are terminated (or the beginning of the current statement is obvious and unambiguous), most IntelliSense functions don't care if there are errors outside of the current statement. SELECT 1;
At first you may see an error message about your connection being disconnected or forcibly closed, depending on your version of Management Studio. You just need to try one more time to remind SSMS that, even though the server was temporarily disconnected, it is still there.
SELECT SERVERPROPERTY('ProductVersion');If this query yields a build number starting with "8." or "9.", then IntelliSense is not working because the target version is not supported.
SELECT SERVERPROPERTY('Edition');If the result is "SQL Azure" then that is why IntelliSense is not working.
There are a number of reasons why the completion list may not actually be complete or that an object or column name is underlined and marked as incorrect. One is quite common, but several others are possible too.
USE command, or if the database is changing in other query windows or by other users. You can refresh the cache by pressing Ctrl+Shift+R or by selecting the menu option Edit > IntelliSense > Refresh Local Cache. As above, you may need to wait for the cache to fully load, depending on the size of your metadata and other resources involved.

These don't show up under the dbo schema in auto-complete either, in case you were wondering.
SQL Server 2012 Books Online outlines a variety of other potential issues in the topic Troubleshooting IntelliSense (SQL Server Management Studio). There are topics for other versions of SQL Server as well: SQL Server 2008 | SQL Server 2008 R2. There's even a SQL Server 2005 topic, presumably added to Books Online at a time when they intended to include IntelliSense in that version of Management Studio (which they never did, of course).
I hope that gives you some avenues to try if you are finding that IntelliSense isn't working (partially or at all). And if you've shied away from IntelliSense in SSMS 2008 or SSMS 2008 R2, I hope you'll give it another shake in SSMS 2012.
| Thursday, August 02, 2012 - 8:05:09 AM - Thomas Pullen | Read The Tip |
|
I have just discovered that blocking during a database restore (on 2012 rtm) can cause Intellisense to stop working too. It appears whatever SSMS does in the background to populate its cache can't coexist with the db restore. |
|
| Friday, September 28, 2012 - 12:34:44 PM - anon | Read The Tip |
|
Intellisense wasn't working for me after installing even though the settings you mentioned were all correct. Disabling Intellisense and then re-enabling it fixed the problem for me.
|
|
| Saturday, October 20, 2012 - 11:37:31 AM - David Basri | Read The Tip |
|
The big issue in my opinion is that SMSS 2012 Intellisense is simply less efficient than SMSS 2008 Intellisense. For SQL 2012 an additional keystroke is required for almost every object. In SMSS 2008 when the list was narrowed to one object you could just press enter to insert it. In SMSS 2012 you have to hit a down arrow or click on the object to select it. I did discover that pressing Ctrl-Enter selects the "suggested" object, but that is still an additional keystroke. |
|
| Sunday, October 21, 2012 - 12:56:55 PM - Aaron Bertrand | Read The Tip |
|
David, I don't think they could create a version of IntelliSense that satisfies everyone. Personally I like the new version better for this reason: when I am looking for a DMV involving, say, transactions, I don't have to know whether it starts with dm_db_ or dm_tran_ or dm_os_ or what have you. I san type: sys.tran And the auto-complete list is populated with items that *contain* "tran" - unlike in 2008, where I would already have eliminated the list to objects that *start* with "tran." For me that's a big win and, since I found IntelliSense hardly usable at all in 2008 (in fact I almost always turned it off completely), I'm still way ahead in terms of productivity, extra keystroke or not. Like many things, YMMV. |
|
| Sunday, October 21, 2012 - 7:29:20 PM - David Basri | Read The Tip |
|
You are certainly correct that no software can please everyone. Ever. This seems to be a question of the intended use. You are looking for items among the plethora of system objects. I tend to just be looking to complete standard column, table or view objects. You are trying to locate objects and I am trying to speed up typing queries. This was annoying enough for me to comment on because the 2008 version worked so well for what I needed it to do. I will get used to Ctrl-Enter soon enough.
|
|
| Tuesday, November 13, 2012 - 5:42:16 PM - Robert | Read The Tip |
|
Is there a way to control the 'accept' keys for intellisense? I am really annoyed that the spacebar accepts a partial word when only tab or enter should be the only ones. |
|
| Sunday, November 18, 2012 - 7:28:18 AM - Dmitry | Read The Tip |
|
Same question, as Robert's. I am really annoyed that when I hit spacebar, Intellisense chooses to enter some word from the list. I just want to enter spacebar. In Visual Studio Intellisense can be in 2 modes: suggesting mode, completion mode. Suggesting mode makes Intellisense paste the highlighted word only by pressing enter or tab, spacebar only enters space as expected. Is there something similar in SQL Server Management Studio? |
|
| Sunday, November 18, 2012 - 12:07:01 PM - Aaron Bertrand | Read The Tip |
|
Robert and Dmitry, I don't know how to control this behavior, but on my machine spacebar does not auto-accept partial words - I have to manually scroll to the selected word in order for spacebar to complete the word. |
|
| Thursday, November 29, 2012 - 1:21:55 PM - Marlon Jimenez | Read The Tip |
|
I fulfill the given check list, however Intellisense never worked. The problem was for a specific database. Solution: Disassociate the user from that database and then associate it again!!!! Hope it helps. |
|
| Friday, May 31, 2013 - 10:23:41 AM - Andrew | Read The Tip |
|
Thanks for sharing this info. Unfortinately it hasn't helped me. I'm using SSMS 2012 Enterprise Edition and despite performing all the tasks and checks you've mentioned in this article, intellisense still does not work for me. I've even tried some of the suggestions in the comments as well as suggestions from other articles. If I type something as simple as "select * from sys." I would expect the sys object list to popup, alas it does not. This is extremely frustrating and pretty much makes me want to use some other tool that actually works. I've never had a problem with intellisense in Toad for example. This is something that you'd think wouldn't require so much attnetion, but apparently MS ephed it up somehow. It's comepletely useless. |
|
|
privacy | disclaimer | copyright | advertise | about authors | contribute | feedback | giveaways | user groups Some names and products listed are the registered trademarks of their respective owners. Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com |