Query to list all stored procedures

后端 未结 23 1281
暖寄归人
暖寄归人 2020-11-28 17:18

What query can return the names of all the stored procedures in a SQL Server database

If the query could exclude system stored procedures, that would be even more he

相关标签:
23条回答
  • 2020-11-28 18:01
    SELECT name, 
           type
      FROM dbo.sysobjects
     WHERE (type = 'P')
    
    0 讨论(0)
  • 2020-11-28 18:01

    If you are using SQL Server 2005 the following will work:

    select *
      from sys.procedures
     where is_ms_shipped = 0
    
    0 讨论(0)
  • 2020-11-28 18:06

    You can try this query to get stored procedures and functions:

    SELECT name, type
    FROM dbo.sysobjects
    WHERE type IN (
        'P', -- stored procedures
        'FN', -- scalar functions 
        'IF', -- inline table-valued functions
        'TF' -- table-valued functions
    )
    ORDER BY type, name
    
    0 讨论(0)
  • 2020-11-28 18:06

    This can also help to list procedure except the system procedures:

    select * from sys.all_objects where type='p' and is_ms_shipped=0
    
    0 讨论(0)
  • 2020-11-28 18:06

    Try this codeplex link, this utility help to localize all stored procedure from sql database.

    https://exportmssqlproc.codeplex.com/

    0 讨论(0)
  • 2020-11-28 18:07
    select *  
      from dbo.sysobjects
     where xtype = 'P'
       and status > 0
    
    0 讨论(0)
提交回复
热议问题