This is all within a TSQL stored procedure. I have a variable that contains the name of a stored procedure I want to execute, up until now this method has been used only with stored procedures that do no take arguments. I'm having troulbe fitting a proc that does take an argument into the same mold.
In my main driver procedure I have a line EXECUTE @process_name
and @process_name
is normally something like 'database..procedure' with no arugments. How do I fit the name of a stored proc and its arguments into one string so that when I call the line EXECUTE @process_name
it will execute the procedure with arguments?
I can't change this execute line at all, I really need to fit the proc name and arguments into the single string @process_name. I realize it may not be the best practice.
Thanks for any help!