title: Return all id's from table in store procedure
body: <p>I'm continue discovering <code>SQL</code> and store procedure, having trouble that <code>@feedid</code> is returning only 1 id, but it have for ex. 20. How to return array of id's? </p>
  
  <pre><code>CREATE PROC spGetItemsByUser
      @userName NVARCHAR(50)
  AS BEGIN
  
      DECLARE @userId INT,
              @feedId INT;
  
      SELECT @userId = ID
      FROM users
      WHERE name = @userName
  
      SELECT @feedId = feedid
      FROM userstofeed
      WHERE userid = @userId
  
      SELECT *
      FROM feed
      WHERE ID = @feedId
  
  END
  </code></pre>