Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2001-06-06
4
Medium Priority
?
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

618 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