Invalid Object Name sql
Solution 1
Make sure you're using the correct database. It may be defaulting to the "Master" database, and it doesn't look like you have the full schema for the referenced table.
Ex: [DatabaseName].[Schema].[TableName]
or [Database1].[smmdmm].[aid_data]
Hope this helps.
Solution 2
Try:
Edit -> IntelliSense -> Refresh Local Cache
Solution 3
According to the error you're receiving I assume that you're using MSSQL.
at the beginning of your queries try:
use [YOUR_DATABASE_NAME];
and then your query. It helped in my case.
Solution 4
This works for me : Edit -> IntelliSense -> Refresh Local Cache
Solution 5
There might be 2 reasons for it.
Table name is wrong
Sol: Verify the table name and try to execute
Database name and schema name are not mentioned with the table name in query
Sol: Mention the database and schema name in SQL query.
For ex:
select * from MESQLDBM.dbo.Alert ([DatabaseName].[Schema].[TableName])
user3814197
Updated on July 09, 2022Comments
-
user3814197 almost 2 years
I keep getting an invalid object name error on my sql code. (
member_number, subscriber_policy_number
) is underlined with the error message.The code itself runs fine with no errors, why does this happen? None of the code above this is highlighted
update smmdmm.aid_data set Member_Number = Subscriber_Policy_Number where Member_Number in ('000000000','000000001')
-
Phil almost 10 yearsWhich DBMS? Where do you see these errors?
-
Martin Smith almost 10 yearsProbably you need to refresh the intellisense cache assuming SSMS.
-
user3814197 almost 10 yearsrelational dbms using sql server management studio
-
user3814197 almost 10 yearstried a refresh of the intellisense cache, but had no impact
-
Aelian over 9 yearsHad the same problem and refreshing intellisense cache as mentioned here worked for me in SSMS.
-
Yusuf Uzun almost 8 yearsDon't forget to set user's default schema, if you have any schema over tables.
-
Baljeet Singh over 4 yearsPossible duplicate of sql server invalid object name - but tables are listed in SSMS tables list
-
-
Tom Wilson almost 9 yearsNice and simple for a developer who doesn't use a DB in their normal course of work. Works for me - thanks.
-
Sev09 over 7 years"Ctrl + Shift + r" is a shortcut for this, as well.
-
Ganesh Kamath - 'Code Frenzy' over 6 yearsThank you. I really appreciate you leaving this answer in this discussion.
-
Nico Haase over 6 yearsIs this related to the question in any way?