获取某一数据库的所有存储过程的名字

SELECT    name AS spname
FROM    sysobjects
WHERE    xtype = 'p'
ORDER BY name

xtype是sysobjects表中的一列, 其中存储的是对象的类型. 从上面的语句可以看出'p'代表的是存储过程, 那么其他的类型呢?

以下是xtype的部分列表.

  • C = CHECK constraint
  • D = Default or DEFAULT constraint
  • F = FOREIGN KEY constraint
  • L = Log
  • P = Stored procedure
  • PK = PRIMARY KEY constraint (type is K)
  • RF = Replication filter stored procedure
  • S = System table
  • TR = Trigger
  • U = User table
  • UQ = UNIQUE constraint (type is K)
  • V = View
  • X = Extended stored procedure
  • FN = Function

资料来源:

Get All the Stored Procedure Names In One Shot

http://www.devx.com/tips/Tip/27129

Use Sysobjects in SQL Server to Find Useful Database Information

http://www.devx.com/tips/Tip/14107

原文地址:https://www.cnblogs.com/awpatp/p/1718280.html