Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid Object Name sql

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')
like image 672
user3814197 Avatar asked Jul 07 '14 22:07

user3814197


People also ask

What does invalid object name mean in SQL?

Resolution: 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...

What is SQL object name?

In a SQL statement, you represent the name of an object with a quoted identifier or a nonquoted identifier. A quoted identifier begins and ends with double quotation marks ("). If you name a schema object using a quoted identifier, then you must use the double quotation marks whenever you refer to that object.


1 Answers

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.

like image 189
Sev09 Avatar answered Sep 19 '22 13:09

Sev09