是否可以查询存储过程列表以及提供给它们的参数?我找到了一些查询,但它没有返回提供的参数。我只是想知道这是否可能。或者我需要为这种日志创建一些脚本?
BTW,我正在使用SQL Server。
谢谢!
答案 0 :(得分:2)
请尝试以下
SELECT *
FROM sys.procedures pr
inner join sys.parameters p
on p.object_id = pr.object_id
您可以添加name = 'MyProcName'
如果您还想获得最后一次执行:请使用以下内容:
SELECT last_execution_time, *
FROM sys.procedures pr
inner join sys.parameters p
on p.object_id = pr.object_id
INNER JOIN sys.objects b
ON pr.object_id = b.object_id
left join sys.dm_exec_procedure_stats a
on a.object_id = pr.object_id
答案 1 :(得分:0)
你走了:
SELECT SYSOBJ.NAME AS SP_NAME,
PARAMS.NAME AS PARAMNAME
FROM SYS.OBJECTS AS SYSOBJ
INNER JOIN SYS.PARAMETERS AS PARAMS ON SYSOBJ.OBJECT_ID = PARAMS.OBJECT_ID
WHERE SYSOBJ.TYPE='P'