-- 获取数据库列表
SELECT name FROM master.dbo.sysdatabases ORDER BY name
-- 获取存储过程列表
-- Type = ‘P‘ --> 存储过程
-- Category = 0 --> 用户创建的
SELECT * FROM sysobjects WHERE type = ‘ P ‘ AND category = 0 ORDER BY name
-- 获取存储过程内容
-- Name = Stored Procedure Name.
SELECT text
FROM syscomments
WHERE id = ( SELECT id FROM sysobjects WHERE name = ‘ 存储过程名称 ‘)