什么查询可以返回SQL Server数据库中所有存储过程的名称
如果查询可以排除系统存储过程,那将更有帮助。
什么查询可以返回SQL Server数据库中所有存储过程的名称
如果查询可以排除系统存储过程,那将更有帮助。
当前回答
SELECT name,
type
FROM dbo.sysobjects
WHERE (type = 'P')
其他回答
select *
from dbo.sysobjects
where xtype = 'P'
and status > 0
这也可以帮助列出除了系统过程之外的过程:
select * from sys.all_objects where type='p' and is_ms_shipped=0
exec sp_stored_procedures; Docs.Microsoft.com
很容易记住。
SELECT name,
type
FROM dbo.sysobjects
WHERE (type = 'P')
不幸的是,INFORMATION_SCHEMA不包含系统进程的信息。
SELECT *
FROM sys.objects
WHERE objectproperty(object_id, N'IsMSShipped') = 0
AND objectproperty(object_id, N'IsProcedure') = 1