January 29, 2013 at 4:55 pm
How can I pass a pre-set parameter to a stored proc, for example;
DECLARE @param1 VARCHAR(MAX)
SET @param1 = 'value1, value2, value3'
EXEC usp_doStuff @command1 = 'Some stuff goes here', @command2 = @param1;
When I try this I get "Must pass parameter number 2 and subsequent parameters as '@name = value'."
I probably (hopefully) missing something easy here, any help appreciated. Thanks!
January 29, 2013 at 5:41 pm
ReamerXXVI (1/29/2013)
How can I pass a pre-set parameter to a stored proc, for example;DECLARE @param1 VARCHAR(MAX)
SET @param1 = 'value1, value2, value3'
EXEC usp_doStuff @command1 = 'Some stuff goes here', @command2 = @param1;
When I try this I get "Must pass parameter number 2 and subsequent parameters as '@name = value'."
I probably (hopefully) missing something easy here, any help appreciated. Thanks!
Um, you should be fine there, unless there's further parameters in the proc itself that don't have defaults.
Can you show us the header of the proc usp_doStuff? Everything between the CREATE and the AS, at the least.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
January 29, 2013 at 6:09 pm
Hi, thanks for your reply, you are absolutely right, it does work.
I was making a mistake elsewhere, all resolved now.
Thanks again.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply