I have a stored procedure which returns a value (ex: GetData)
How can I declare a variable in another function to get this value?
Something like this
Create Function Test
Return Int
Begin
Declare @data My_Data_Type
Declare @count int
SET @data = exec GetData
Select @count = count(*)
From @data
Return @count
End
Please help me !!!!
If your stored procedure returns table then do
If you want to return scalar valus e.g. int, varchar, use OUTPUT parameter
Then retrieve it this way