SQL SERVER如何获取指定数据库中所有存储过程的参数

SELECT sp.object_Id as FunctionId, sp.name as FunctionName,
            isnull(param.name,'')as ParamName,isnull(usrt.name,'') AS [DataType],
            ISNULL(baset.name, '') AS [SystemType], CAST(CASE when baset.name is null then 0  WHEN baset.name IN ('nchar', 'nvarchar') AND param.max_length <> -1 THEN param.max_length/2 ELSE param.max_length END AS int) AS [Length],
            '' as ParamReamrk,isnull(parameter_id,0) as SortId
            FROM sys.objects AS sp  INNER JOIN sys.schemas b ON sp.schema_id = b.schema_id
            left outer JOIN sys.all_parameters AS param ON param.object_id=sp.object_Id
            LEFT OUTER JOIN sys.types AS usrt ON usrt.user_type_id = param.user_type_id
            LEFT OUTER JOIN sys.types AS baset ON (baset.user_type_id = param.system_type_id and baset.user_type_id = baset.system_type_id) or ((baset.system_type_id = param.system_type_id) and (baset.user_type_id = param.user_type_id) and (baset.is_user_defined = 0) and (baset.is_assembly_type = 1)) 
           LEFT OUTER JOIN sys.extended_properties E ON sp.object_id = E.major_id
            WHERE sp.TYPE in ('FN', 'IF', 'TF','P')  AND ISNULL(sp.is_ms_shipped, 0) = 0 AND ISNULL(E.name, '') <> 'microsoft_database_tools_support'
            ORDER BY sp.name,param.parameter_id ASC



实例


查询SQL SERVER 系统数据库 master 中的所有存储过程参数


 


文章转载自: SQL SERVER如何获取指定数据库中所有存储过程的参数  http://www.studyofnet.com/news/1205.html




评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值