like that you can select value by calling function from stored procedure
ALTER PROC [dbo].[USP_StoreProcedureName]
(
@UserId int=0
)
AS
BEGIN
select dbo.Fun_FunctionName(@UserId)
end
ALTER Function [dbo].[Fun_FunctionName]
(
@UserId int=0
)
Returns varchar(50)
AS
Begin
DECLARE @ReturnValue VARCHAR(20)
set @ReturnValue
return @ReturnValue
end