title: Stored Procedure To set a variable value to a Individual column
body: <p>I have a <code>Table structure</code> as </p>
  
  <pre><code>Empid Int,
  EmpName Nvarchar,
  Salary Numeric(18,2),
  DeptNumber
  </code></pre>
  
  <p>I have Function which take 2 Argument. as : </p>
  
  <pre><code>ALTER Function [dbo].[GetTotalPrice] 
  (
  @Salary int,
  @DeptNumber int
  )
  RETURNS int
  AS
  BEGIN
  Declare @TotalSalary int
  Select @TotalSalary=@Salary+@DeptNumber 
  return @TotalSalary
  End
  </code></pre>
  
  <p>And my Query is how should i develop a Stored procedure Which takes 
  Each <code>salary</code> and <code>DeptNumber</code> in a Stored Procedure and send that to function and calculate a new Salary. i have tried developing several SP, but could not get any possible solution.</p>
  
  <pre><code>ALTER Proc [dbo].[S7] 
  AS
  BEGIN
  Declare @salary int
  Declare @DeptNo int
  Select EmpId,EmpName, @salary=salary,@DeptNo=DeptNumber,Salary=dbo.GetTotalPrice(@salary,@DeptNo) 
  from dbo.EmpInf
  end
  </code></pre>
  
  <p>When i tried executing the above code it give the following error:</p>
  
  <pre><code>A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.
  </code></pre>