查找存储过程的参数名称 [英] Find the parameter names of a stored procedure
本文介绍了查找存储过程的参数名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是Microsoft SQL Server 2008.我有一个存储过程。是否有一个简单的查询我可以执行,将给我的参数名称?
I am using Microsoft SQL Server 2008. I have a stored procedure. Is there a simple query I can execute that will give me the parameter names?
我发现这链接,但不适用于Microsoft SQL Server 2008。
I have found this Link but it is not for Microsoft SQL Server 2008.
推荐答案
要获取名称,您只能使用此查询:
To get names only you can use this query:
SELECT name
FROM sys.parameters
WHERE object_id = OBJECT_ID('YourProcedureName')
获取更详细的信息(名称,类型和参数长度):
To get more detailed info (name, type and length of parameter):
SELECT p.name AS ParameterName, t.name AS ParameterType, p.max_length AS ParameterLength
FROM sys.parameters AS p
JOIN sys.types AS t ON t.user_type_id = p.user_type_id
WHERE object_id = OBJECT_ID('YourProcedureName')
这篇关于查找存储过程的参数名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文