Invalid Object Name sql

前端 未结 9 1568
面向向阳花
面向向阳花 2020-12-15 22:55

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 it

相关标签:
9条回答
  • 2020-12-15 23:02

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

    0 讨论(0)
  • 2020-12-15 23:02

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

    0 讨论(0)
  • 2020-12-15 23:14

    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.

    0 讨论(0)
  • 2020-12-15 23:15

    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.

    0 讨论(0)
  • 2020-12-15 23:22

    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])
    
    0 讨论(0)
  • 2020-12-15 23:22

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

    0 讨论(0)
提交回复
热议问题