简体   繁体   中英

Query returning all system stored procedures listed by MS SQL Server

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

sysobjects is deprecated. You can use

SELECT QUOTENAME(SCHEMA_NAME(schema_id)) + '.' + QUOTENAME(name)
FROM   sys.all_objects
WHERE  type = 'P'
       AND is_ms_shipped = 1 
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
SELECT *
FROM   sys.all_objects
WHERE  type = 'P'
       AND is_ms_shipped = 1
SELECT name, 
       type
  FROM dbo.sysobjects
 WHERE (type = 'P')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM