title: How to get data from two different tables using stored procedures?
body: <p>I am new to functions so am having a bit starting trouble here </p>
  
  <p>I have two tables like this</p>
  
  <p><strong>Bugs</strong></p>
  
  <pre><code>BugID | Title | ProjectName | CreatedBy
  </code></pre>
  
  <p><strong>BugHistory</strong></p>
  
  <pre><code>BughistoryID | BugID | Assignedto | ToStatus | FromStatus
  </code></pre>
  
  <p><strong>EmployeeTable</strong></p>
  
  <pre><code>EmployeeID | EmployeeName |
  </code></pre>
  
  <p><code>[AssignedTo]</code> column from <code>BugHistory</code> is a foreign key for <code>[EmployeeId]</code> in <code>EmployeeTable</code>.</p>
  
  <p>I want a select statement where I have to show the bugs table in gridview with <code>[AssignedTo]</code> and <code>[Tostatus]</code> columns from <code>BugHistory</code> table. How can I use functions for this both procedure s any ideas please?</p>
  
  <p>In <code>Assigned to</code> column I want the name of the employee - how can I map this?</p>