December 1, 2008 at 3:22 am
We have a new installation of SQL Server 2005 that we have had the AdventureWorks database attached. Whilst I am new to 2005 I have used 2000 for a number of years. I have a curious problem when trying to query the database.
I have a user that I have given sa permissions and although I can view the tables in the management consul without any problems (I can even modify the objects) as soon as I try to do anything via a query window I get a message telling me the object doesn't exist.
For example
select * from HumanResources.Department
I get this message
Msg 208, Level 16, State 1, Line 1
Invalid object name 'Department'.
If I right click the object in the object explorer and open table I see the 16 rows as I would expect. It does seem to be a problem only with AdventureWorks as i have created tables in a test database and I can query them fine.
Hopefully I am doing something silly?
December 3, 2008 at 7:13 am
Sounds like a typo. In SSMS open a new query window, type select * from and then drag and drop the table name from the object explorer to the query window and run the query. Or Right-Click the table in object explorer and select script object to new window as select and run it.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 3, 2008 at 11:29 am
could be Typo
or make sure you run the query in the AdventureWorks database, not in 'master' (usually the default DB after login)
December 4, 2008 at 8:59 am
dear All. I have to confess to still being a little confused. When I next went back inrto the Management studio it was fine as if the permissions were not set until I closed the Management Studio. Still get a slightly strange error when I first run a query against tables in a session, see below against a different table;
Msg 2809, Level 18, State 1, Line 1
The request for procedure 'Address' failed because 'Address' is a table object.
When I then execute the code again it returns the details in address table??.
Thanks anyway
December 8, 2008 at 12:39 pm
Operating system? version of SS2k5 (Express, std, enterprise...)?
Language settings? Sounds like a funky setting is getting impacted when you first open, then fixes itself upon closing. Or some other conflict between operating system and sql server? Just speculating - insufficient data.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply