Kerzoz
Kerzoz

Reputation: 331

SQL Server does not recognize table even after being refreshed

I have a table named SlotInPlantTransaction

As we can see clearly in this picture that the table really does, exist and I even have inserted values into the table using a Stored Procedure

enter image description here

However, if I try to select the table or want to update a column inside the table, somehow SQL Server said that the table does not exist enter image description here

I made sure that the server and the database it connected to is the right one, along with refreshing the IntelliSense too, but it does not have any effect.

I could do fine with calling the table from right-clicking in the Object Explorer, but this way I can't make my update Stored Procedure work.

Anyone ever had similar issue?

Upvotes: 1

Views: 2184

Answers (1)

Paul Karam
Paul Karam

Reputation: 4225

Most likely, you're querying the wrong database.

As you stated, when you right click the table in the object explorer, it's working. This would be because SSMS will run the USE function on your behalf to query the right database/table.

A fast and easy way to fix that error would be calling the USE function.

USE [DatabaseName] --Make sure to insert the DB name, not the table name.
SELECT * FROM SlotInPlantTransaction

Another way would be by choosing the right database from the top left AvailableDatabases drop down list, as shown in this picture:

SSMS

You change the master to your DatabaseName that you pick from the list.

Upvotes: 4

Related Questions