16

I am running SQL-2008 R2 Server.

Usually when I write a query, I get a full-versed IntelliSense displaying all the objects in my Database.

But now when I was onto a task, it showed no IntelliSense. Instead, when I wrote the object names, it showed that object is invalid! However, running the Query gives correct results.

I shut-down the Management studio and restarted it. Now all works fine.

I wanna know what was actually wrong. Any ideas?

Martin Hollingsworth
  • 7,249
  • 7
  • 49
  • 51
Kameron
  • 703
  • 3
  • 10
  • 23

5 Answers5

23

You probably needed to refresh it. Either

  1. Go to Edit -> IntelliSense -> Refresh Local Cache
  2. Use Ctrl+Shift+R
gbn
  • 422,506
  • 82
  • 585
  • 676
  • 1
    You need to have focus on the query window, else this menu item will not appear and Ctrl+Shift+R won't work. – Luke Sep 25 '14 at 09:03
  • When you create a new entity in SQL like - table, view, sprc... you need to clear the cache, otherwise you will not have IntelliSense. For me shortcut Ctrl+Shift+R works as a charm on SSMS 18.10 – Dany Jul 25 '22 at 11:06
2

From another question I answered... there is way to auto fresh without having to manually do Control Shift R time.

I found an addin that offers a free community edition addin. SSMS Boost offers some helpful features that bypass the shortcomings of SSMS.

To auto refresh, I setup the shortcut for F5 to Run Query and then Auto Refresh Intellisense. Now, everytime I execute, my intellisense cache is automatically refreshed. Seems to replicate the functionality of auto refresh in Red Gate's SQL Prompt Experimental functionality.

sheldonhull
  • 1,807
  • 2
  • 26
  • 44
2

A picture is worth a 1000 words.

enter image description here

nobody
  • 10,892
  • 8
  • 45
  • 63
0

To activate IntelliSense for Column Names:

First type the FROM clause (FROM tblEmps), then second, go back and type the SELECT clause (SELECT EmpID, LName).

This way IntelliSense will help you pick out the Column Names to include in your SELECT statement.

SELECT __________
FROM tblEmps

The trick here is to type the FROM clause prior to typing the SELECT clause, so IntelliSense knows which Columns to suggest.

Matt Lemmon
  • 169
  • 1
  • 2
  • 13
0

I've found that sometimes you have to do a database "refresh" before the Cache refresh step given by others.

Refreshing the database (before Cache refresh step)

FloverOwe
  • 302
  • 2
  • 8