问题
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?
回答1:
You probably needed to refresh it. Either
- Go to Edit -> IntelliSense -> Refresh Local Cache
- Use
Ctrl+Shift+R
回答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.
回答3:
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.
回答4:
A picture is worth a 1000 words.
来源:https://stackoverflow.com/questions/7055911/lost-the-intellisense-in-sql-server-management-studio