Invalid Object Name : 'sysdatabases'
-
Hello, This is Vikash. I have an application where on starting the application it connects to SQL Server 2000. At this point of connection I also execute the query 'Select Name From Sysdatabases' to get a list of database names. The problem is at my PC using My SQL Server 2000, the Query is getting executed properly giving me a list of databases. But when I install the software on one of the clients PC where my database is attached to their existing MSSQL Server 2000, it display the error message, "Invalid Object Name 'sysdatabases'". Can somebody tell me why this is happening. Has somebody faced similar problems. Please any help would be highly appreciated. Thanks in Advance.
-
Hello, This is Vikash. I have an application where on starting the application it connects to SQL Server 2000. At this point of connection I also execute the query 'Select Name From Sysdatabases' to get a list of database names. The problem is at my PC using My SQL Server 2000, the Query is getting executed properly giving me a list of databases. But when I install the software on one of the clients PC where my database is attached to their existing MSSQL Server 2000, it display the error message, "Invalid Object Name 'sysdatabases'". Can somebody tell me why this is happening. Has somebody faced similar problems. Please any help would be highly appreciated. Thanks in Advance.
Check the permissions of your connection credentials. Typically a developer assigns himself god rights to their database and lose sight of the fact that a DBA will never do that on a production server.
Never underestimate the power of human stupidity RAH
-
Check the permissions of your connection credentials. Typically a developer assigns himself god rights to their database and lose sight of the fact that a DBA will never do that on a production server.
Never underestimate the power of human stupidity RAH
Thanks for the reply Mycroft. but can you tell me what credentials you are talking about. My Connection string is : Server=<Servername>;Database=<DBname>;Uid=<UserID>;Pwd=<Password>; what else do I need to provide. Is It That Sysdatabases will work only if I have access rights to all the databases in the instance. bcoz, my client also has several other databases in this instance which I am connecting and I might not have rights to those databases. Awaiting your reply.
-
Thanks for the reply Mycroft. but can you tell me what credentials you are talking about. My Connection string is : Server=<Servername>;Database=<DBname>;Uid=<UserID>;Pwd=<Password>; what else do I need to provide. Is It That Sysdatabases will work only if I have access rights to all the databases in the instance. bcoz, my client also has several other databases in this instance which I am connecting and I might not have rights to those databases. Awaiting your reply.
sysdatabases lives in the master database, your credentials may not have rights to that database. You probably need to arrange r/o access for those credentials to the master database or event the sysdatabase table if that is the only table you need.
Never underestimate the power of human stupidity RAH
-
Hello, This is Vikash. I have an application where on starting the application it connects to SQL Server 2000. At this point of connection I also execute the query 'Select Name From Sysdatabases' to get a list of database names. The problem is at my PC using My SQL Server 2000, the Query is getting executed properly giving me a list of databases. But when I install the software on one of the clients PC where my database is attached to their existing MSSQL Server 2000, it display the error message, "Invalid Object Name 'sysdatabases'". Can somebody tell me why this is happening. Has somebody faced similar problems. Please any help would be highly appreciated. Thanks in Advance.
Have you tried prepending 'sys.' to it. eg. select * from sys.sysdatabases?
Regards, Rob Philpott.