title: sql server trigger pulling data from joined table
body: <p>i want to create a trigger for insert update and delete on a table that is linked with other tables 
  when any of the above happens the trigger should pull one values from the inserted table and other values from the joined tables 
  and insert those into another table </p>
  
  <p>here is a simplified answer, but i am getting an error on the employee join saying The multi-part identifier could not be bound</p>
  
  <pre><code>Create TRIGGER triggertest
  ON salary 
  FOR INSERT
  AS 
  BEGIN
  
  
  DECLARE @salary int
  DECLARE @firstName int
  
  
  SELECT @salary = i.salary, @firstName =employee.firstName
  FROM inserted i 
  
  
          INNER JOIN employee  ON
               i.employeeID = emplopyee.employeeID 
          INNER JOIN deleted d ON  i.salaryID = d.salaryID 
  
  
  
  
  
      INSERT INTO testTAble
      (employeeFirstName,EmployeeSalary)
      select @firstName ,@salary 
  
  END
  </code></pre>