Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 "Poll" a stored procedure

Author  Topic 

paulj
Starting Member

4 Posts

Posted - 2005-10-06 : 08:45:23
is there a way to "poll a stored procedure to determine how many parameters it needs?

What I want to do is dynamically use stored procedures and on the fly determine how many parameters it requires.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-06 : 08:50:31
Is this?

Select parameter_name from information_schema.parameters
where Specific_name ='spname'

What is the need of this requirement?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2005-10-06 : 08:55:26
select specific_name, parameter_name, ordinal_position, parameter_mode, data_type
from information_schema.parameters
order by specific_name

Duane.
Go to Top of Page

paulj
Starting Member

4 Posts

Posted - 2005-10-06 : 09:08:51
Exactly what I needed. Thanks! Want to be able to dynamically call on stored procedures but need to know beforehand what parameters we will need to send it.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-06 : 09:51:09
note that this will require 2 trips to the db instead of just one if you know the sproc.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-10-06 : 11:21:07
If you are doing this client-side there is a method in ADO to refresh the parameters for an SProc

Set oCMD = Server.CreateObject("ADODB.Command")
... set up parameters for oCMD including SProc name ...
oCmd.Parameters.Refresh

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-07 : 01:21:37
Kris, are you master in Client side as well?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-10-07 : 01:27:48
Just a master in the art of Cut&Paste
Go to Top of Page
   

- Advertisement -