May 15, 2009 at 9:35 pm
The error "Invalid object name 'Table Name'" is coming up when execute a SELECT, INSERT, etc., where Table Name is the name of the table I'm attempting to access. The BUILTIN\Administrators and sa logins are both members of the sysadmin server role. I get the same Thanks in advance to anyone with suggestions.
May 15, 2009 at 9:51 pm
if it literally says 'table name' , with a space, you'll need to wrap any name with spaces in double quotes or brackets:
SELECT * from [My Table Name] WHERE [First Name] = 'Bob'
or
SELECT * from "My Table Name" WHERE "First Name" = 'Bob'
Lowell
May 15, 2009 at 10:12 pm
Hello. Thanks for your response. The name of my table is users with no spaces.
May 15, 2009 at 10:30 pm
then it is probably owned by a different schema than dbo, and needs to be identified by that.
what is the real, exact error message?
maybe if you have a user named "webdev", and that user created a table, it needs to be referenced by SELECT * FROM webdev.NewTable, and not just NewTable (which assumes it is owned by dbo.NewTable
do Select * from Information_Schema.Tables and see if the table exists in there, and who the owner is.
Lowell
May 15, 2009 at 11:23 pm
I executed the command: SELECT * FROM Information_Schema.Tables and the users table wasn't in there. The schema for the users table is dbo. Under the object explorer, I right click the table name and click properties, then I add my windows login as a user, check the select grant permission check box. Then when I run the SELECT * FROM users I see the results rendered from my web app, but when I disconnect from SQL Server and run the same query I get the error message:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'users'.
May 17, 2009 at 4:36 am
What collation are you using?
If you are using a CS (Case Sensitive) collation then you will have to refer to the object using exactly the same case as it appears e.g. Users, USERS, users will all be different.
May 17, 2009 at 6:08 am
I'm using the Latin1_General Collation with the Accent-Sensitive option checked.
May 17, 2009 at 6:17 am
Does the user that the web app connects as have rights to that table?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 17, 2009 at 7:02 am
I'm using Windows Authentication and I have the database role of db_owner and own the dbo_owner schema. Is this sufficient?
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply