2013-10-09 17 views
0

都在MSSQL参数,我能做到以下几点 - 现在我使用PHP和SQLSRV - 我该如何实现在PHP同样如何获得当我使用ASP存储过程

Set oCmd = Server.CreateObject("ADODB.Command") 
Set oCmd.ActiveConnection = oConn 
oCmd.CommandText = "dbo.spGetItem" 
oCmd.CommandType = &H0004 'adCmdStoredProc 
oCmd.Parameters.Refresh 

For Each prmTemp In oCmd.Parameters 
     Response.Write(prmTemp.direction & "<br/>" & prmTemp.name) 
Next 

Set oCmd = Nothing 

回答

1
select ORDINAL_POSITION, PARAMETER_NAME, DATA_TYPE, PARAMETER_MODE from information_schema.parameters 
where specific_name='Proc_Name' 
+1

http://sqlblog.com/blogs/ aaron_bertrand /存档/ 2011/11/03 /的情况下,AGA inst-information-schema-views.aspx –

+0

非常感谢它的一个很好的阅读非常丰富:)现在我从这里开始读它从头到尾:) –

2

的无论客户端语言最简单的方法是只查询元/目录视图:

SELECT name, is_output 
    FROM sys.parameters 
    WHERE [object_id] = OBJECT_ID('dbo.spGetItem'); 
+1

叶氏,PHP MSSQL扩展并未提供具体的通过功能的元信息 –