Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Invalid object name 'sys.databases'

Author  Topic 

sagarthanawala
Starting Member

1 Post

Posted - 2008-05-15 : 05:36:38
Hello,

Iam on MS-Sqlserver 2005 and Iam trying to add a job thru Mgmt studio.

The job steps are :-

1] Step name :- Query DB
Type :- Transact-SQL script (T-SQL)
Database :- Master
Command :- select count(*) from sys.databases.

This job run every 2 mintues and Iam getting the following error whenever this job executes :-

Name :- DB Heartbeat
owner :- NA\sqlserver-svc
Category :- Database Maintenance


Step ID 1
Server SQ05ADB\SQ05ADB
Job Name DB Heartbeat
Step Name Query DB
Duration 00:00:00
Sql Severity 16
Sql Message ID 208
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0

Message
Executed as user: NA\sqlserver-svc. Invalid object name 'sys.databases'. [SQLSTATE 42S02] (Error 208). The step failed.

Please let me know.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-15 : 08:40:55
Remove . after sys.databases

quote:
Originally posted by sagarthanawala

Hello,

Iam on MS-Sqlserver 2005 and Iam trying to add a job thru Mgmt studio.

The job steps are :-

1] Step name :- Query DB
Type :- Transact-SQL script (T-SQL)
Database :- Master
Command :- select count(*) from sys.databases.

This job run every 2 mintues and Iam getting the following error whenever this job executes :-

Name :- DB Heartbeat
owner :- NA\sqlserver-svc
Category :- Database Maintenance


Step ID 1
Server SQ05ADB\SQ05ADB
Job Name DB Heartbeat
Step Name Query DB
Duration 00:00:00
Sql Severity 16
Sql Message ID 208
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0

Message
Executed as user: NA\sqlserver-svc. Invalid object name 'sys.databases'. [SQLSTATE 42S02] (Error 208). The step failed.

Please let me know.


Go to Top of Page

mahalirajesh
Starting Member

2 Posts

Posted - 2010-01-25 : 23:06:36
Hi

i am try to execute the following query in MSsql2008 Query editor
USE master
GO
select count(*) from sys.databases

i am getting following erro
Go to Top of Page

mahalirajesh
Starting Member

2 Posts

Posted - 2010-01-25 : 23:07:59
Hi

i am try to execute the following query in MSsql2008 Query editor
USE master
GO
SELECT name FROM sys.databases
GO
select count(*) from sys.databases
GO

i am getting following error
Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.databases'.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-26 : 02:18:39
quote:
Originally posted by mahalirajesh

Hi

i am try to execute the following query in MSsql2008 Query editor
USE master
GO
SELECT name FROM sys.databases
GO
select count(*) from sys.databases
GO

i am getting following error
Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.databases'.


are you sure version of db you're connecting to is >= 2005

try below and see what it returns

SELECT SERVERPROPERTY('productversion')


also in future post your question as a new thread. dont hijack old threads
Go to Top of Page
   

- Advertisement -