Invalid object name LocalDb Table

hubatish

I'm trying to run a simple SQL query on a LocalDb database in Visual Studio 2013.

Here's the query in a file GrabWords.sql:

SELECT * FROM Words

where Words is a table in the NextGen.mdf database. When I run this, I get the error:

Invalid object name 'Words'.

For more information, I actually have two databases in the project. In the Solution explorer one is called NextGen.mdf, and the other Cards.mdf. In server explorer, the first (that I am trying to query) is called AutoGenEntities and the other is CardsDBContext.

I just want to run this query to test queries and view the database - is there another tool I should be using to do this?

Jason Roell

Try this:

USE [your Database name]
SELECT * FROM Words

This should ensure that you are targeting the correct database.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Invalid object name with #tem_table

From Dev

"Invalid object name" when referring to a table

From Dev

Invalid Object name '##Temporary_table'

From Dev

Getting " SQLGrammarException: Invalid object name " on fetching table data

From Dev

Getting " SQLGrammarException: Invalid object name " on fetching table data

From Dev

Invalid object name 'C'

From Dev

Invalid object name for cte

From Dev

Invalid object name error

From Dev

INVALID OBJECT NAME 'Student'

From Dev

Unable to create table. Invalid object name 'master.dbo.DDLevents' when creating a new object

From Dev

sql dependency Invalid object name '

From Dev

Using sqlcmd with FOR XML returns Invalid Object name 'dbo.Table' yet Query runs in SSMS

From Dev

SQL Server 2005 BCP xml data error invalid object name temp table

From Dev

Can not drop a temp table Invalid object name '#Temp1' error - in sql server

From Dev

Identity throws "Invalid object name 'dbo.AspNetUserClaims'" after removing that table

From Dev

Need help. Message says temp table doesn't exist: 'Invalid object name '#TempCodes'.'

From Dev

Invalid object name even though the object is valid

From Dev

SQL server Invalid Column name Invalid object name

From Dev

LocalDB, table definition with comments

From Dev

Getting invalid column name using a pivot table

From Dev

NHibernate generates an invalid table name with SqlCe inserts

From Dev

Getting invalid column name using a pivot table

From Dev

Invalid table name without using a reserved word?

From Dev

Oracle create table Invalid Name / Constraint

From Dev

Ora-00903 invalid table name

From Dev

Invalid table name while bulk insert in oracle

From Dev

Invalid column name for table type parameter

From Dev

Invalid object name 'dbo.Item'

From Dev

Invalid object name after pushing to azure

Related Related

  1. 1

    Invalid object name with #tem_table

  2. 2

    "Invalid object name" when referring to a table

  3. 3

    Invalid Object name '##Temporary_table'

  4. 4

    Getting " SQLGrammarException: Invalid object name " on fetching table data

  5. 5

    Getting " SQLGrammarException: Invalid object name " on fetching table data

  6. 6

    Invalid object name 'C'

  7. 7

    Invalid object name for cte

  8. 8

    Invalid object name error

  9. 9

    INVALID OBJECT NAME 'Student'

  10. 10

    Unable to create table. Invalid object name 'master.dbo.DDLevents' when creating a new object

  11. 11

    sql dependency Invalid object name '

  12. 12

    Using sqlcmd with FOR XML returns Invalid Object name 'dbo.Table' yet Query runs in SSMS

  13. 13

    SQL Server 2005 BCP xml data error invalid object name temp table

  14. 14

    Can not drop a temp table Invalid object name '#Temp1' error - in sql server

  15. 15

    Identity throws "Invalid object name 'dbo.AspNetUserClaims'" after removing that table

  16. 16

    Need help. Message says temp table doesn't exist: 'Invalid object name '#TempCodes'.'

  17. 17

    Invalid object name even though the object is valid

  18. 18

    SQL server Invalid Column name Invalid object name

  19. 19

    LocalDB, table definition with comments

  20. 20

    Getting invalid column name using a pivot table

  21. 21

    NHibernate generates an invalid table name with SqlCe inserts

  22. 22

    Getting invalid column name using a pivot table

  23. 23

    Invalid table name without using a reserved word?

  24. 24

    Oracle create table Invalid Name / Constraint

  25. 25

    Ora-00903 invalid table name

  26. 26

    Invalid table name while bulk insert in oracle

  27. 27

    Invalid column name for table type parameter

  28. 28

    Invalid object name 'dbo.Item'

  29. 29

    Invalid object name after pushing to azure

HotTag

Archive