Thursday, March 22, 2012

Error on Query to Sys Views (e.g. sys.objects)

I've just installed SQL Server 2005 Developer Edition, upgraded from SQL Server 2000, and have encountered a problem in trying to query against the System Catalogs.

I've tried SELECT * FROM sys.objects in addition to SELECT suser_name( role_principal_id ) FROM sys.server_role_members. In both cases I receive the following error: Invalid object name 'sys.objects' or 'sys.server_role_members' in the second example.

I changed the properties of the registration for my local db instance to use SQL authentication in lieu of Windows authentication. I used the sa login account to see if that made a difference, no go.

Can someone *please* tell me what I'm doing wrong here?

I would also like to know if it's possible to run a query confirming the user account I'm logged in to the system as.


Thanks!

what i feel is you are still connecting to SQL Server 2000. post the result of

Select @.@.Version

run the above query in query anlyser from where you are getting this error and post the result

you might have only installed Tools...

Madhu

|||

That was it Madhu. Thanks for the prompt reply. I had assumed that in upgrading to Sql Server 2005 all databases were pushed to the 2005 engine. Is there a manual step I must complete in order to do just that?

In addition, can you tell me how to query the user account I'm logged in as?

Thanks again

|||

(a) install SQL Server 2005

(b) use backup/restore or detach /attach method to transfer the database

(c) make script of other server level objects like jobs etc and run it in sql server 2005 instance

To fine user account : SELECT SUSER_SNAME()

Madhu

|||Thanks again for the feedback!

No comments:

Post a Comment