Solved

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

Posted on 2001-06-06
4
258 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:nathans
  • 3
4 Comments
 
LVL 6

Expert Comment

by:acampoma
ID: 6160420


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
 
LVL 6

Accepted Solution

by:
acampoma earned 50 total points
ID: 6160465
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
 
LVL 5

Author Comment

by:nathans
ID: 6160560
Thanks... Is there a way to not show System SP's only User ones?
0
 
LVL 6

Expert Comment

by:acampoma
ID: 6160586
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

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
best counters for cpu high usage 3 35
MS SQL + Insert Into Table - If Doesnt Exist 9 36
Update a text value in another table 10 43
SQL view 2 27
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question