How can I create a Stored Procedure to list all Stored Procedures?

How can I create a Stored Procedure to list all Stored Procedures in Date Order?

and another for Triggers?

and for Databases?


Thanks for you help...

I know this is simple for you dba's.
LVL 5
Nathan Stanford SrSenior ProgrammerAsked:
Who is Participating?
 
acampomaConnect With a Mentor Commented:
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  OFF
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[up_Test]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[up_Test]
GO

create proc dbo.up_Test

AS
select * from sysobjects where xtype='P' order by crdate
select * from sysobjects where xtype='TR' order by crdate
select * from master..sysdatabases order by crdate
GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO
0
 
acampomaCommented:


select * from sysobjects where xtype='P' order by crdate
select * from sysobjects where xtype='TR' order by crdate
select * from master..sysdatabases order by crdate
0
 
Nathan Stanford SrSenior ProgrammerAuthor Commented:
Thanks... Is there a way to not show System SP's only User ones?
0
 
acampomaCommented:
where status=0 or category=0
I'm not sure what these fields mean. I just noticed that they are both set to 0 for all my user stored procs.
good luck
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.