9

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

4

4 回答 4

14

sysobjects已弃用。您可以使用

SELECT QUOTENAME(SCHEMA_NAME(schema_id)) + '.' + QUOTENAME(name)
FROM   sys.all_objects
WHERE  type = 'P'
       AND is_ms_shipped = 1 
于 2013-09-12T11:49:35.397 回答
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
于 2013-09-12T11:08:22.613 回答
2
SELECT *
FROM   sys.all_objects
WHERE  type = 'P'
       AND is_ms_shipped = 1
于 2013-09-12T11:26:09.597 回答
0
SELECT name, 
       type
  FROM dbo.sysobjects
 WHERE (type = 'P')
于 2013-09-12T11:12:22.627 回答