title: getting error while RETURN two statement - sql function
body: <pre><code>ALTER FUNCTION [dbo].[UDF_GetExpenseDetails](@EmpID nvarchar(50))    
  RETURNS NVARCHAR(MAX) 
  AS    
  BEGIN    
     DECLARE @ExpAmount nvarchar(MAX)
     DECLARE @ExpName nvarchar(MAX)    
  
     IF (@EmpID &lt;&gt; '')    
     BEGIN    
        SELECT distinct 
           @ExpAmount = SE.ExpenseAmount, @ExpName = ME.ExpenseName
        FROM 
           tbl_admin_supplierempexpense SE, tbl_master_expense ME
        WHERE 
           SE.EmpID = @EmpID 
           AND SE.ExpenseName = ME.ExpenseID 
           AND SE.Status = 'P'  
  
     END    
  
     RETURN @ExpAmount,@ExpName   
  
  END
  </code></pre>
  
  <p>ERROR : Incorrect syntax near ','.</p>