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.
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.parameterswhere Specific_name ='spname'What is the need of this requirement?MadhivananFailing to plan is Planning to fail |
|
|
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_typefrom information_schema.parametersorder by specific_nameDuane. |
|
|
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. |
|
|
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 |
|
|
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 SProcSet oCMD = Server.CreateObject("ADODB.Command")... set up parameters for oCMD including SProc name ...oCmd.Parameters.RefreshKristen |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-07 : 01:21:37
|
Kris, are you master in Client side as well? MadhivananFailing to plan is Planning to fail |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-10-07 : 01:27:48
|
Just a master in the art of Cut&Paste |
|
|
|
|
|