Assuming Emp,EmpHistory 2 tables with same schema: EmpId(Int), Name(varchar(50)), DeptId(Int). If a company wants to move all rows for Employees working in IT Department, and who resigned from company to a new table EMPHistory then which of the following is correct statement?

 Posted by Bandi on 9/30/2013 | Category: Sql Server Interview questions | Views: 2102 | Points: 40
Select from following answers:
  1. DELETE FROM EMP OUTPUT deleted.* INTO EmpHistory FROM Emp JOIN deptON EMP.DeptId = Dept.DeptId WHERE DeptName='IT';
  2. DELETE FROM EMP OUTPUT deleted.* INTO EmpHistory FROM Emp JOIN Dept ON EMP.DeptId = Dept.DeptId ;
  3. DELETE FROM EMP OUT PUT deleted.* INTO EmpHistory FROM Emp JOIN deptON EMP.DeptId = Dept.DeptId WHERE DeptName='IT';
  4. None of the above
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response