Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql server invalid object name - but tables are listed in SSMS tables list

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)

like image 842
Richbits Avatar asked Sep 01 '09 13:09

Richbits


People also ask

Why does SQL say invalid object name?

This typically means 1 of 2 things... you've referenced an object (table, trigger, stored procedure,etc) that doesn't actually exist (i.e., you executed a query to update a table, and that table doesn't exist). Or, the table exists, but you didn't reference it correctly...

Why is my table not showing in SQL?

For those using SQL Server Management Studio 2016 you simply need to hit 'F5' or go to 'View > Refresh' and your recently added tables should appear.

How do I refresh SQL Server Management Studio?

Select the Edit menu, select IntelliSense, then select Refresh Local Cache. Use the CTRL+Shift+R keyboard shortcut.


1 Answers

Try:

Edit -> IntelliSense -> Refresh Local Cache

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

NOTE: Your cursor must be in the query editor for the IntelliSense menu to be visible.

like image 135
Adam Robinson Avatar answered Oct 13 '22 01:10

Adam Robinson