Reputation: 187
Using SqlServer 2005, is it possible to do something like this where SomeFunction returns a value. Eg 1234
EXEC [dbo].[SomeStoredProcedure] @SomeParameter = SomeFunction()
Upvotes: 1
Views: 1260
Reputation: 31
Seems I don't have enough reputation to comment on the accepted answer.
Here's a more concise syntax where the declaration and the assignation of the variable is done in one line:
Declare @FunctionResult int = dbo.YourFunction()
Exec dbo.YourStoredProcedure @FunctionResult
Upvotes: 0
Reputation: 44024
You will need to declare a variable first to hold the result of the function. You can then pass the variable to the stored procedure
Declare @FunctionResult int
Select @FunctionResult = dbo.YourFunction()
Exec dbo.YourStoredProcedure @FunctionResult
Upvotes: 5