SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Invalid object name 'sys.databases'
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sagarthanawala
Starting Member

1 Posts

Posted - 05/15/2008 :  05:36:38  Show Profile  Send sagarthanawala a Yahoo! Message  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 05/15/2008 :  08:40:55  Show Profile  Reply with Quote
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.



Edited by - sodeep on 05/15/2008 08:42:17
Go to Top of Page

mahalirajesh
Starting Member

Malaysia
2 Posts

Posted - 01/25/2010 :  23:06:36  Show Profile  Click to see mahalirajesh's MSN Messenger address  Send mahalirajesh a Yahoo! Message  Reply with Quote
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

Malaysia
2 Posts

Posted - 01/25/2010 :  23:07:59  Show Profile  Click to see mahalirajesh's MSN Messenger address  Send mahalirajesh a Yahoo! Message  Reply with Quote
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

India
52249 Posts

Posted - 01/26/2010 :  02:18:39  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000