title: How can I populate a value in a select statement using a stored procedure?
body: <p>Precursor: <strong>I have to use the stored procedure</strong> and I'm using SQL Server 2000. I also need to spit out a table so that Reporting Services can use it properly. I can create any database object to help get the data however.</p>
  
  <p>So, Here's an example of my select statement (I'm hoping I made this look the same as what I'm actually using)</p>
  
  <pre><code>SELECT     
      Store.Store_ID, 
      Store.Store_Description, 
      Salaries.Income, 
      Salaries.Tax_Rate, 
      Managers.Manager_Name, 
      Employees.Employee_ID
  
  FROM         
      Store INNER JOIN
      Managers ON Managers.Store_ID = Store.Store_ID INNER JOIN
      Employees ON Managers.Manager_ID = Employees.Manager_ID INNER JOIN
      Salaries ON Employees.Salary_Type_ID = Salaries.Salary_Type_ID 
  WHERE (Store.Store_ID = 20561) 
  ORDER BY Employee_ID
  </code></pre>
  
  <p><strong>EDIT :Since the procedure returns a single value, all I I want to do is this:</strong></p>
  
  <pre><code>SELECT     
      Store.Store_ID, 
      Store.Store_Description, 
      Salaries.Income, 
      Salaries.Tax_Rate, 
      Managers.Manager_Name, 
      Employees.Employee_ID,
      Exec proc_Get_Emplyee_estimation_Costs Employee_ID    
  FROM         
      Store INNER JOIN
      Managers ON Managers.Store_ID = Store.Store_ID INNER JOIN
      Employees ON Managers.Manager_ID = Employees.Manager_ID INNER JOIN
      Salaries ON Employees.Salary_Type_ID = Salaries.Salary_Type_ID 
  WHERE (Store.Store_ID = 20561) 
  ORDER BY Employee_ID
  </code></pre>
  
  <p>I know I can't do that obviously, but I need to be able to use the procedure on each line using the employee number. I'm not sure how to go about this.</p>
  
  <p><strike>Can I create a function where I can use the results of the select statement in the procedure, and then tack it on to the table and return the table to Reporting Services?</strike></p>