views:

2154

answers:

6

I am attempting to create a Stored Procedure for a newly created database. However the SSMS intellisense does not recognize more than half of the tables which have been created.

For example whilst in the left hand column under tables I have a table dbo.Room, when I type "dbo." in the new query window, that table is not listed, in fact only 17 out of 37 tables are listed. I can see no difference between the tables listed by intellisense and those not. If I manually type dbo.Room, it is underlined, with an error of "Invalid Object Name 'dbo.Room'.".

Have I missed something in setting up the tables?

UPDATE: I have tried refresh of the tables list (several times)

+1  A: 

did you try: right click the database, and click "refresh"

KM
Yes, I've tried that, I am sure it is there, I can add records and modify etc.Just did a Select * from dbo.Room and whilst I still have the underline it outputted the contents of the table. I'm gonna try a reboot.
Richbits
+2  A: 

Are you certain that the table in question exists?

Have you refreshed the table view in the Object Explorer? This can be done by right clicking the "tables" folder and pressing the F5 key.

You may also need to reresh the Intellisense cache.

This can be done by following the menu route: Edit -> IntelliSense -> Refresh Local Cache

John Sansom
what is with the trivial edits of other people's answers? you added a period to my answer and a colon to @Adam Robinson's answer. what games are you playing?
KM
I don't have enough time for games but I can be a little OCD when it comes to grammar ;-)
John Sansom
+8  A: 

Try:

Edit -> IntelliSense -> Refresh Local Cache

This should refresh the data cached by Intellisense to provide typeahead support and pre-execution error detection.

Adam Robinson
Thanks, I suspect that this would have solved. I actually restarted SSMS and found that that solved. Probably should have done that in first place, but my initial thought was I had done something wrong in setup.
Richbits
Does Intellisense/SSMS refresh itself periodically? Or must this always be a manual process? (I've got my guess based on SSMS in 2005, but one can always hope.)
Philip Kelley
+1  A: 

Are you using the correct database? I sometimes forget to change the database in the drop down when I am in the query window and usually get this error msg.

VBCSharp
A: 

Sorry for a late reply, but ctrl+shift+r refreshes intellisense in management studio 2008 as well.

Zielyn
A: 

Why there is a need to refresh intellisense anyway? I thought it would refresh itself.

Grig
Because sometimes it doesn't or doesn't refresh when you need it.
Jay Stevens