title: How do I return multiple values from a function and how to invoke the function and assign the values returned to local variables? (T-SQL)
body: <p>I'm new to SQL Server and I would like to ask a query
  Suppose I have a function which returns four values like e.g.</p>
  
  <p><code>set @RetValue=@PendingFlag + @Status + @BTFound + @ValueDate</code> and  <code>RETURN @RetValue</code>. 
  Now suppose im invoking this function from another function like suppose: </p>
  
  <pre><code>DECLARE @d VARCHAR(max)
  SET@d=dbo.ValidateBTtype(@BType,@ReadBT,@Type,@Id,@ClientId,@Customerno,@InterestDate,@ApplicationType)
  </code></pre>
  
  <p>In <code>@d</code> il have all the four values 
  But what I want to do is I want the returned values and I want to store it separately in local variables like local variable <code>@PendingFlag=</code>returned value (<code>@Pending Flag</code>) local variable <code>@Status</code>=returned value (<code>@Status</code>) and etc.. </p>
  
  <p>Please help me how to store the returned values separately in the second function by invoking the first function</p>