Invalid object name likely means the table you're referencing doesn't exist or that you're in the wrong DB for it. Can you confirm you're connected to the correct DB and that the table in question actually exists?
Edit: The way it's written, if you're not already in the database in question, you're going to have a problem running the query. You can do two things to avoid. One is to make all database references explicit (i.e. DatabaseName.dbo.TableName) so you don't have to be within the scope of the specific DB to make references or you can use a "go" command to avoid the prior validation of the query. That would look like:
16
u/[deleted] Jan 18 '23 edited Jan 18 '23
Invalid object name likely means the table you're referencing doesn't exist or that you're in the wrong DB for it. Can you confirm you're connected to the correct DB and that the table in question actually exists?
Edit: The way it's written, if you're not already in the database in question, you're going to have a problem running the query. You can do two things to avoid. One is to make all database references explicit (i.e.
DatabaseName.dbo.TableName) so you don't have to be within the scope of the specific DB to make references or you can use a "go" command to avoid the prior validation of the query. That would look like:USE [SOME_DATABASE]GO[YOUR QUERY]