title: Assign single variable a multiple rows using Select query in stored procedure
body: <p>My query is to assign single variable a multiple rows using Select
  query in stored procedure
  For example:
  I get 10(say 1 to 10) employee ids from from Employee table
  declare @id int</p>
  
  <pre><code>select @id =EmpId from Employee
  
  select @id
  </code></pre>
  
  <p>This will return 10 rows(i.e.Employee id , suppose there are 10 rows in a
  table) now my question is how i will get this all rows in a single variable
  and use that employee id one by one to perform some calculation.</p>