Query to list all stored procedures
SELECT name,
type
FROM dbo.sysobjects
WHERE (type = 'P')
From my understanding the "preferred" method is to use the information_schema tables:
select *
from information_schema.routines
where routine_type = 'PROCEDURE'
As Mike stated, the best way is to use information_schema
. As long as you're not in the master database, system stored procedures won't be returned.
SELECT *
FROM DatabaseName.INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE'
If for some reason you had non-system stored procedures in the master database, you could use the query (this will filter out MOST system stored procedures):
SELECT *
FROM [master].INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE'
AND LEFT(ROUTINE_NAME, 3) NOT IN ('sp_', 'xp_', 'ms_')