I have found this code in my job:
exec dbo.get_name @id = @id, @name = @name output
What does it mean? I couldn't find any examples using this syntax nor any information on Microsoft pages.
When executing a storedprocedure, parameters can be passed in a different order than defined in the procedure. You have to use @parameterName to tell which parameter is passed at which position.
There are two separate things in your code:
@id and @name parameters The code could maybe be more understandable, if it was written this way:
exec dbo.get_name @id = @customerId, @name = @customerName output
In @id = @id, the first @id is a named parameter for the dbo.get_name stored procedure.
The second @id is a local variable that supplies the value for the parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With