Need help again..
I have this table:
||1-Run , 0 =Skip
As you can see all my SP parameters stored in a table.
Now.. I have SP_01, value=1 means it will run using the value from Mode=1 and Name='test01'
this is how it looks like:
execute SP_01 mode,name
You think this is possible??
Thank you in advance.
Why would you need to do this? you could have them as optional parameters and then handle within the code. I'm still trying to work out the scenario that this is used. Can you add more information?
You do this a couple of different ways.
Have the proc itself look up the param value(s) based on a control value. That is, add another column to give the parameters table a unique column value, such as identity or a code, then pass that value into the proc so it can retrieve the other param values based on that.
Use the "standard" XML string concatenation to generate the string to exec the proc with parameters from the table, then exec that string.
Thank you for your response...
Well, I want to simplify my codes and to manage my parameters in one table. And I want to do it in a dynamic sql...