Reputation: 1027
Could you suggest please how to execute from Sql Server a stored procedure that receives an input parameter? I tried this but it failed:
EXEC GetFilmsInCategory('SF');
The stored procedure is correctly defined, by the way. I executed it from the visual interface and it worked, with this code generated automatically:
DECLARE @return_value int
EXEC @return_value = [dbo].[GetFilmsInCategory] @CatNume = N'SF'
SELECT 'Return Value' = @return_value
I find this automatically generated code too... lengthy as I was expecting something similar to what I initially tried:
EXEC GetFilmsInCategory('SF');
Can you fix this or offer an alternative? Thank you!
Anna
Upvotes: 1
Views: 10471
Reputation: 3493
You can also address the parameters by name:
EXEC GetFilmsInCategory @CatNume = 'SF'
Upvotes: 3