查询返回MS SQL Server列出的所有系统存储过程

时间:2013-09-12 11:08:23

标签: sql sql-server sql-server-2012

如何使用SQL查询获取MS SQL Server(2012)列出的所有系统存储过程?

4 个答案:

答案 0 :(得分:12)

sysobjects已弃用。你可以使用

SELECT QUOTENAME(SCHEMA_NAME(schema_id)) + '.' + QUOTENAME(name)
FROM   sys.all_objects
WHERE  type = 'P'
       AND is_ms_shipped = 1 

答案 1 :(得分:4)

SELECT sch.name + '.' + obj.name
  FROM sysobjects obj, sys.schemas sch
  WHERE obj.type = 'P'
    AND sch.schema_id = obj.uid
    AND sch.name = 'sys'
    --AND obj.name like '%my_search_string%'--use this for filtering
  ORDER BY sch.name + '.' + obj.name

答案 2 :(得分:2)

SELECT *
FROM   sys.all_objects
WHERE  type = 'P'
       AND is_ms_shipped = 1

答案 3 :(得分:0)

SELECT name, 
       type
  FROM dbo.sysobjects
 WHERE (type = 'P')