Invalid Object Name sql

北战南征 提交于 2019-11-29 03:45:21

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.

Try:

Edit -> IntelliSense -> Refresh Local Cache

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.

GSK

There might be 2 reasons for it.

  1. Table name is wrong

    Sol: Verify the table name and try to execute

  2. 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])

In my case, I was missing modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

This works for me : Edit -> IntelliSense -> Refresh Local Cache

It happened to me in a function and it was a table within that had been dropped long time ago

I came to this page as I kept getting this error each time I ran the program, anyway I found that in the settings my SQL string table name was missing the underscore and should have been as follows; tbl_Customer.

Md. Zakir Hossain

I faced case sensitivity problem. Below was my erroneous query

SELECT * FROM [bccci$Biochemical View] AS ibv 

here "V"- 1st character of last part of table name is Upper case but in actual table name it was lower case. that is [bccci$Biochemical view]. So my correct code was

SELECT * FROM [bccci$Biochemical view] AS ibv 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!