December 29, 2011 at 12:45 pm
I am trying to run the following query on SQL Server 2008 R2:
USE MyDB;
GO
SELECT name AS procedure_name
,SCHEMA_NAME(schema_id) AS schema_name
,type_desc
,create_date
,modify_date
FROM sys.procedures;
GO
And the error is Invalid object name 'sys.procedures'.
Pl can someone advice on how to make the above query work in SQL Server 2008 R2.?
Also when I try to run SELECT * FROM sys.objects
It also gives me the error saying Invalid object name 'sys.objects'
But when I run this query SELECT * FROM sysobjects
It works.
Is it sys.object or sysobject.?
Pl can someone advise on these 2 queries?
And also how to
December 29, 2011 at 12:49 pm
Please run the following and post the results
SELECT @@Version
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 29, 2011 at 1:32 pm
Gail,
My mistake,I was running the query on SQL Server 2000.
Thanks and Regards
December 29, 2011 at 1:47 pm
Thought as much. On SQL 2000 use sysobjects. On 2005 and above, it is sys.procedures and sys.objects.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply