什么查询可以返回SQL Server数据库中所有存储过程的名称

如果查询可以排除系统存储过程,那将更有帮助。


当前回答

这个,列出所有你想要的东西

在Sql Server 2005, 2008, 2012:

Use [YourDataBase]

EXEC sp_tables @table_type = "'PROCEDURE'" 
EXEC sp_tables @table_type = "'TABLE'"
EXEC sp_tables @table_type = "'VIEW'" 

OR

SELECT * FROM information_schema.tables
SELECT * FROM information_schema.VIEWS

其他回答

根据我的理解,“首选”方法是使用information_schema表:

select * 
  from information_schema.routines 
 where routine_type = 'PROCEDURE'

不幸的是,INFORMATION_SCHEMA不包含系统进程的信息。

SELECT *
  FROM sys.objects
 WHERE objectproperty(object_id, N'IsMSShipped') = 0
   AND objectproperty(object_id, N'IsProcedure') = 1

试试这个codeplex链接,这个实用程序帮助本地化sql数据库中的所有存储过程。

https://exportmssqlproc.codeplex.com/

在SQL server中选择存储过程列表。更多信息请参考这里: https://coderrooms.blogspot.com/2017/06/select-list-of-stored-procedure-in-sql.html

exec sp_stored_procedures; Docs.Microsoft.com

很容易记住。