什么查询可以返回SQL Server数据库中所有存储过程的名称
如果查询可以排除系统存储过程,那将更有帮助。
什么查询可以返回SQL Server数据库中所有存储过程的名称
如果查询可以排除系统存储过程,那将更有帮助。
当前回答
这将显示所有的存储过程和代码:
select sch.name As [Schema], obj.name AS [Stored Procedure], code.definition AS [Code] from sys.objects as obj
join sys.sql_modules as code on code.object_id = obj.object_id
join sys.schemas as sch on sch.schema_id = obj.schema_id
where obj.type = 'P'
其他回答
试试这个codeplex链接,这个实用程序帮助本地化sql数据库中的所有存储过程。
https://exportmssqlproc.codeplex.com/
这将只给出存储过程的名称。
select specific_name
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
select *
from dbo.sysobjects
where xtype = 'P'
and status > 0
选择“所有存储过程和视图”
select name,type,type_desc
from sys.objects
where type in ('V','P')
order by name,type