title: Stored procedure to select from multiple tables
body: <p>I have created a stored procedure that takes an argument </p>
  
  <pre><code>ALTER procedure [dbo].[myprocedure](@myName char(20))
  as
     select param1
     from table1
     where name = @myName
  </code></pre>
  
  <p>Now this is working but when I try to select parameters from other tables it is not working I tried like this after the first select</p>
  
  <pre><code>(Select param2 table2)
  </code></pre>
  
  <p>But I get </p>
  
  <blockquote>
    <p>MS 512, Level 16, State 1, Procedure candidate, Line 3<br>
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.</p>
  </blockquote>
  
  <p>Does anyone know hot to use the select to get values from more than one table? Thanks</p>