title: joins- how to pass the parameter in stored procedure to execute a join query
body: <p>I have used joins to get data from two tables under common name, as</p>
  
  <pre><code>SELECT userValidity.UserName, userValidity.ValidFrom,userValidity.ValidUpTo,userValidity.TotalPoints, 
  persons.SenderID
  FROM userValidity
  INNER JOIN persons
  ON userValidity.Username=tbl_persons.Username 
  </code></pre>
  
  <p>But I need to execute this query with only the username which I pass as parameter in stored procedure..</p>
  
  <p>How to pass the username in stored procedure in this joins.</p>
  
  <pre><code>alter procedure GetNameIDUserInformation
  (
  @user varchar(max)
  )
  as
  begin
  
  SELECT userValidity.UserName, userValidity.ValidFrom,userValidity.ValidUpTo,userValidity.TotalPoints, 
  persons.SenderID
  FROM userValidity
  INNER JOIN persons
  ON userValidity.Username=tbl_persons.Username 
  end
  </code></pre>
  
  <p>In this SP, where I have to pass the user parameter to get the single row of my user record?</p>