Stored Procedure Defintion

  • I am trying to locate all the Stored Procedures and their respective definitions, or at least a descriptions, that come with SQL 2000. I have a current list that I pulled using 'sp_stored_procedures' but it does not give the definitions. Does anyone know how I could possible get both?

    Thanks so very much for your time. Hope that you have a wonderful day.

    Andrew 🙂

    How long a minute is....

    Depends on what side of the bathroom door you are on.


    How long a minute is....
    Depends on what side of the bathroom door you are on.

  • I think I might consider generate a T-SQL scripts in EM to generate a listing of all stored procedures.

    Would that work for you?

    -------------------------

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • If you wanna do it programatically then use this to get all procedure names

    select name from sysobjects where xtype = 'p'

    now get the procedure definition from syscomments table

    Cheers,

    Prakash

    Prakash Heda
    Lead DBA Team - www.sqlfeatures.com
    Video sessions on Performance Tuning and SQL 2012 HA

  • If all you want is a list of names simply run

    SELECT Name FROM SysObjects WHERE TYPE='P'

    P = Stored Procs

    V = Views

    TR = Triggers

    If you want the actual definitions then try

    SELECT text

    FROM syscomments INNER JOIN sysobjects ON syscomments.id = sysobjects.id

    WHERE sysobjects.type='P'

    ORDER BY syscomments.id , syscomments.colid

  • Try

    select * from information_schema.routines

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply